Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Improve usability of coverage types (#820)
Browse files Browse the repository at this point in the history
- Weaken argument bounds to `IntoIterator`
- Reduce log level to `debug`
  • Loading branch information
ranweiler authored Apr 20, 2021
1 parent d8ab124 commit c262295
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/agent/coverage/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl CommandBlockCov {
/// Returns `true` if the module was newly-inserted (which initializes its
/// block coverage map). Otherwise, returns `false`, and no re-computation
/// is performed.
pub fn insert(&mut self, path: &ModulePath, offsets: impl Iterator<Item = u32>) -> bool {
pub fn insert(&mut self, path: &ModulePath, offsets: impl IntoIterator<Item = u32>) -> bool {
use std::collections::btree_map::Entry;

match self.modules.entry(path.clone()) {
Expand All @@ -42,7 +42,7 @@ impl CommandBlockCov {
let entry = self.modules.entry(path.clone());

if let btree_map::Entry::Vacant(_) = entry {
log::warn!(
log::debug!(
"initializing missing module when incrementing coverage at {}+{:x}",
path,
offset
Expand Down Expand Up @@ -100,8 +100,8 @@ pub struct ModuleCov {
}

impl ModuleCov {
pub fn new(offsets: impl Iterator<Item = u32>) -> Self {
let blocks = offsets.map(|o| (o, BlockCov::new(o))).collect();
pub fn new(offsets: impl IntoIterator<Item = u32>) -> Self {
let blocks = offsets.into_iter().map(|o| (o, BlockCov::new(o))).collect();
Self { blocks }
}

Expand Down
4 changes: 2 additions & 2 deletions src/agent/coverage/src/block/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ impl<'c> Recorder<'c> {
log::debug!("set {} breakpoints for module {}", info.blocks.len(), path);
}
Ok(None) => {
log::warn!("could not find module: {}", path);
log::debug!("could not find module: {}", path);
}
Err(err) => {
log::warn!("could not disassemble module {}: {:?}", path, err);
log::debug!("could not disassemble module {}: {:?}", path, err);
}
}

Expand Down

0 comments on commit c262295

Please sign in to comment.