Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Dec 11, 2013

Ref #7173.

@ghost
Copy link
Author

ghost commented Dec 11, 2013

A couple of things:

  • I'm not a fan of the description I've given of this syntax, it doesn't flow very well. Improvements are much desired.
  • Should something be written for the manual as well?
  • Are there instructions around for updating doc/po/tutorial.md.pot?

doc/tutorial.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write this as c @ (a, b) (just stylistic; and do it below too). Also, writing the a and b prints as {} rather than {:?} would be nicer.

@huonw
Copy link
Contributor

huonw commented Dec 11, 2013

I think this might be clearer (or would at least benefit from) having a subpattern as-pattern. i.e.

let x: Option<(u8, i16)> = foo();
match x {
    Some(tuple @ (a, b)) => { ... }
    None => { ... }
}

(Also, note that Haskell calls these "as patterns", and I personally don't see a reason to depart from this nomenclature; others might have a better name though.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to not have unused variables like b here, and a, b in the example below. For this one, replacing it with _ would be ok, for the one below, maybe print them as well as the entire tuple?

@emberian
Copy link
Contributor

Closing due to inactivity; feel free to reopen!

@emberian emberian closed this Jan 11, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
allow disabling module inception on private modules

Fixes rust-lang#10842

changelog: Enhancement [`module_inception`]: Added `allow-private-module-inception` configuration.
[rust-lang#10917](rust-lang/rust-clippy#10917)
<!-- changelog_checked -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants