Skip to content

Commit

Permalink
style: satisfy newest clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Sep 29, 2024
1 parent 8f83f1e commit b35a97b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion elfo-core/src/dumping/extract_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn strip_known_wrappers(mut s: &str) -> &str {
}

fn extract_path(s: &str) -> &str {
if let Some(idx) = s.find(|c| c == '<' || c == '>' || c == ',') {
if let Some(idx) = s.find(['<', '>', ',']) {
&s[..idx]
} else {
s
Expand Down
5 changes: 1 addition & 4 deletions elfo-dumper/src/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ impl Serializer {
}
true
})
.map_err(|err| {
self.output.truncate(prev_len);
err
})
.inspect_err(|_| self.output.truncate(prev_len))
}

pub(crate) fn take(&mut self) -> (Option<&[u8]>, Report) {
Expand Down
2 changes: 1 addition & 1 deletion elfo-telemeter/src/render/openmetrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fn sanitize_label_key(key: &str) -> Cow<'_, str> {
}

fn sanitize_label_value(value: &str) -> Cow<'_, str> {
if value.contains(|c: char| c == '\\' || c == '"' || c == '\n') {
if value.contains(['\\', '"', '\n']) {
value.into()
} else {
value
Expand Down

0 comments on commit b35a97b

Please sign in to comment.