Skip to content

Conversation

@steveklabnik
Copy link
Contributor

Rust by Example is far better.

Fixes #14380.

@alexcrichton
Copy link
Member

There are some relevant lines in configure and mk/docs.mk as well.

@aturon
Copy link
Contributor

aturon commented Jun 23, 2014

Is everything on the cheat sheet also in Rust by Example at this point?

@steveklabnik
Copy link
Contributor Author

@alexcrichton ahhh, grep fail. I will update this soon.

@steveklabnik
Copy link
Contributor Author

@alexcrichton updated.

@aturon unsure, but I'm not sure it's a big deal for this kind of thing. These cheats change over time, as people know more about the language.

@alexcrichton
Copy link
Member

r=me with a squash

Rust by Example is far better.

Fixes rust-lang#14380.
@steveklabnik
Copy link
Contributor Author

Squashed.

@steveklabnik steveklabnik deleted the remove_cheat_sheet branch October 25, 2017 18:25
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 25, 2025
Previously expect_fun_call would too eagerly convert cases like
`foo.expect(if | block | match)` into `foo.unwrap_or_else`.
Additionally, it would also add to_string() even though the argument is
being passed into format!() which can accept a &str. I also discovered
some other cases where this lint would either produce invalid results,
or be triggered unnecessarily:

- Clippy would suggest changing expect to unwrap_or_else even if the
expression inside expect contains a return statement
- opt.expect(const_fn()) no longer triggers the lint
- The lint would always add braces to the closure body, even if the body
of expect is a single expression
- opt.expect({"literal"}) used to get turned into
```opt.unwrap_or_else(|| panic!("{}", {"literal"}.to_string()))```

Fixes rust-lang/rust-clippy#15056

changelog: [`expect_fun_call`]: fix expect_fun_call producing invalid
suggestions
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.

Replace official "cheatsheet" with http://rustbyexample.com/

3 participants