Skip to content

Commit

Permalink
ci: update linting toolchain to 1.53
Browse files Browse the repository at this point in the history
This updates the linting toolchain to latest stable version and
fixes a couple of new warnings.

Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
  • Loading branch information
lucab committed Jul 15, 2021
1 parent 1e7736f commit e4dc3fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
CARGO_TERM_COLOR: always
# Pinned toolchain for linting and benchmarks
ACTIONS_LINTS_TOOLCHAIN: 1.47.0
ACTIONS_LINTS_TOOLCHAIN: 1.53.0

jobs:
linting:
Expand All @@ -27,7 +27,7 @@ jobs:
- name: cargo fmt (check)
run: cargo fmt --all -- --check -l
- name: cargo clippy
run: cargo clippy --all -- -D clippy
run: cargo clippy --all -- -D clippy::all
- name: cargo package
run : cargo package && cargo package --manifest-path static-metric/Cargo.toml
criterion:
Expand Down
2 changes: 1 addition & 1 deletion src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl RegistryCore {
let mut id_set = Vec::new();
let mut collector_id: u64 = 0;
for desc in c.desc() {
if id_set.iter().find(|id| **id == desc.id).is_none() {
if !id_set.iter().any(|id| *id == desc.id) {
id_set.push(desc.id);
collector_id = collector_id.wrapping_add(desc.id);
}
Expand Down
4 changes: 2 additions & 2 deletions static-metric/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub fn is_local_metric(metric_type: Ident) -> bool {

pub fn to_non_local_metric_type(metric_type: Ident) -> Ident {
let metric_type_str = metric_type.to_string();
if metric_type_str.starts_with("Local") {
Ident::new(&metric_type_str[5..], Span::call_site())
if let Some(stripped) = metric_type_str.strip_prefix("Local") {
Ident::new(stripped, Span::call_site())
} else {
metric_type
}
Expand Down

0 comments on commit e4dc3fd

Please sign in to comment.