Open
Description
Link to example: http://play.integer32.com/?gist=2d02b966174279055a9519a5f3182a7d&version=undefined
warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
--> src/main.rs:24:9
|
24 | data.data.get(&key).unwrap().clone()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&data.data[&key]`
|
= note: #[warn(get_unwrap)] on by default
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#get_unwrap
Honestly seems like the suggested change should work but lifetimes seem to prevent it. Might be because Index
and get
take slightly different parameter types?
Metadata
Metadata
Assignees
Labels
Category: Clippy is not doing the correct thingCall for participation: This a hard problem and requires more experience or effort to work onIssue: The lint was triggered on code it shouldn't haveIssue: The suggestions provided by this Lint cause an ICE/error when appliedType: Probably requires verifiying types