Skip to content

Commit

Permalink
Fix clippy: use first() instead of get(0)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
  • Loading branch information
matthiasbeyer committed Jun 19, 2022
1 parent c8ee9f1 commit 8b2bdfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl ConfigError {
fn prepend(self, segment: &str, add_dot: bool) -> Self {
let concat = |key: Option<String>| {
let key = key.unwrap_or_default();
let dot = if add_dot && key.as_bytes().get(0).unwrap_or(&b'[') != &b'[' {
let dot = if add_dot && key.as_bytes().first().unwrap_or(&b'[') != &b'[' {
"."
} else {
""
Expand Down

0 comments on commit 8b2bdfe

Please sign in to comment.