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

Improve usability of coverage types #820

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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