Skip to content

Commit

Permalink
clippy fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
anmenaga committed Dec 12, 2024
1 parent e55fa48 commit 0848337
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dsc_lib/src/discovery/command_discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl ResourceDiscovery for CommandDiscovery {
"{spinner:.green} [{elapsed_precise:.cyan}] [{bar:40.cyan/blue}] {pos:>7}/{len:7} {msg:.yellow}"
)?);
pb_span.pb_set_message("Searching for resources");
let _ = pb_span.enter();
pb_span.enter();

let mut resources = BTreeMap::<String, Vec<DscResource>>::new();
let mut adapters = BTreeMap::<String, Vec<DscResource>>::new();
Expand Down Expand Up @@ -276,7 +276,7 @@ impl ResourceDiscovery for CommandDiscovery {
)?);
pb_span.pb_set_message("Searching for adapted resources");
pb_span.pb_set_length(self.adapters.len() as u64);
let _ = pb_span.enter();
pb_span.enter();

let mut adapted_resources = BTreeMap::<String, Vec<DscResource>>::new();

Expand All @@ -296,7 +296,7 @@ impl ResourceDiscovery for CommandDiscovery {
"{spinner:.green} [{elapsed_precise:.cyan}] {msg:.white}"
)?);
pb_adapter_span.pb_set_message(format!("Enumerating resources for adapter '{adapter_name}'").as_str());
let _ = pb_adapter_span.enter();
pb_adapter_span.enter();
let manifest = if let Some(manifest) = &adapter.manifest {
if let Ok(manifest) = import_manifest(manifest.clone()) {
manifest
Expand Down
3 changes: 3 additions & 0 deletions dsc_lib/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl DscProgressBar {
}
}

#[allow(clippy::cast_possible_truncation)]
pub fn pb_inc(&mut self, delta: u64) {
self.ui_bar.pb_inc(delta);
self.position += delta;
Expand All @@ -85,6 +86,7 @@ impl DscProgressBar {
self.emit_json();
}

#[allow(clippy::cast_possible_truncation)]
pub fn pb_set_length(&mut self, len: u64) {
self.ui_bar.pb_set_length(len);
self.length = len;
Expand All @@ -95,6 +97,7 @@ impl DscProgressBar {
}
}

#[allow(clippy::cast_possible_truncation)]
pub fn pb_set_position(&mut self, pos: u64) {
self.ui_bar.pb_set_position(pos);
self.position = pos;
Expand Down

0 comments on commit 0848337

Please sign in to comment.