Skip to content

remove semicolon for suppressed the expressions to unit #19699

Description

@He-Pin

Hi I am new to rust,and when I am reading examples from rust by example,I found this one is really confusing.

This may not always be desired, so the output can be suppressed by ending the expression with a semicolon ;

why not just make the return type as unit,then the return type of the expression just been ignored just like scala.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions