Skip to content

Commit

Permalink
Resolve get_first clippy lint
Browse files Browse the repository at this point in the history
    warning: accessing first element with `variants_from_header.get(0)`
      --> macro/src/load.rs:39:22
       |
    39 |     let span = match variants_from_header.get(0) {
       |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `variants_from_header.first()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
       = note: `-W clippy::get-first` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::get_first)]`
  • Loading branch information
dtolnay committed Oct 22, 2023
1 parent 75ba3fb commit 42621ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macro/src/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(crate) fn load(cx: &mut Errors, apis: &mut [Api]) {
}
}

let span = match variants_from_header.get(0) {
let span = match variants_from_header.first() {
None => return,
Some(enm) => enm.variants_from_header_attr.clone().unwrap(),
};
Expand Down

0 comments on commit 42621ed

Please sign in to comment.