From a379d1445cd7af09406ee8a45c5a72dc95e5d48f Mon Sep 17 00:00:00 2001 From: jtnunley Date: Fri, 6 Jan 2023 10:08:36 -0800 Subject: [PATCH] Increase code coverage by marking certain branches --- src/error.rs | 1 + src/loop_logic.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/error.rs b/src/error.rs index 2dc781a4..5ae27f66 100644 --- a/src/error.rs +++ b/src/error.rs @@ -44,6 +44,7 @@ pub enum Error { impl From 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::::into(err).into() } diff --git a/src/loop_logic.rs b/src/loop_logic.rs index dc349a09..3aefd8b6 100644 --- a/src/loop_logic.rs +++ b/src/loop_logic.rs @@ -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",