Skip to content

Commit

Permalink
Increase code coverage by marking certain branches
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull committed Jan 6, 2023
1 parent 1ffce16 commit a379d14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub enum Error {
impl From<nix::errno::Errno> for Error {
/// Converts a [`nix::Error`] into a wrapped version of the equivalent
/// [`std::io::Error`].
#[cfg_attr(coverage, no_coverage)]
fn from(err: nix::errno::Errno) -> Self {
Into::<std::io::Error>::into(err).into()
}
Expand Down
2 changes: 2 additions & 0 deletions src/loop_logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ impl<'l, Data> LoopHandle<'l, Data> {

// Make sure we won't overflow the token.
if sources.vacant_key() >= MAX_SOURCES_TOTAL {
// We probably can't hit this branch unless we OOM.
#[cfg_attr(coverage, no_coverage)]
return Err(crate::Error::IoError(std::io::Error::new(
std::io::ErrorKind::Other,
"Too many sources",
Expand Down

0 comments on commit a379d14

Please sign in to comment.