Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Condvar docs to use match ergonomics #62857

Closed
KevinWMatthews opened this issue Jul 21, 2019 · 3 comments
Closed

Update Condvar docs to use match ergonomics #62857

KevinWMatthews opened this issue Jul 21, 2019 · 3 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@KevinWMatthews
Copy link
Contributor

In std::sync::Condvar's docs, it looks like line 39:

let &(ref lock, ref cvar) = &*pair2;

and line 51

let &(ref lock, ref cvar) = &*pair;

were written before the match ergonomics RFC was merged.

Is it reasonable/preferable to change these lines to leverage match ergonomics? They would become:

let (lock, cvar) = &*pair2;

and

let (lock, cvar) = &*pair

respectively.

@jonas-schievink jonas-schievink added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jul 21, 2019
@jonas-schievink
Copy link
Contributor

Sounds like a good idea to me. This should probably also be done for all the examples on that type (there's quite a lot using this pattern). Want to send a PR?

@KevinWMatthews
Copy link
Contributor Author

@jonas-schievink Sure! It will give me an excuse to read all of the Condvar documentation in detail.

Centril added a commit to Centril/rust that referenced this issue Jul 24, 2019
…rgo, r=sfackler

Use match ergonomics in Condvar documentation

Documentation was written before match ergonomics was merged. See rust-lang#62857.

In short, replaces

```rust
let &(ref lock, ref cvar) = &*pair;
```

with

```rust
let (lock, cvar) = &*pair
```

in the docs of `std::sync::Condvar`.
Centril added a commit to Centril/rust that referenced this issue Jul 25, 2019
…rgo, r=sfackler

Use match ergonomics in Condvar documentation

Documentation was written before match ergonomics was merged. See rust-lang#62857.

In short, replaces

```rust
let &(ref lock, ref cvar) = &*pair;
```

with

```rust
let (lock, cvar) = &*pair
```

in the docs of `std::sync::Condvar`.
Centril added a commit to Centril/rust that referenced this issue Jul 25, 2019
…rgo, r=sfackler

Use match ergonomics in Condvar documentation

Documentation was written before match ergonomics was merged. See rust-lang#62857.

In short, replaces

```rust
let &(ref lock, ref cvar) = &*pair;
```

with

```rust
let (lock, cvar) = &*pair
```

in the docs of `std::sync::Condvar`.
@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2019

Fixed by #62942

@Amanieu Amanieu closed this as completed Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants