From 53bd7c6679ba0b7a388f2c61a85a8df5e9584963 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Mon, 17 Aug 2020 22:23:45 -0600 Subject: [PATCH] Fix dead code warnings --- src/model/section.rs | 1 + src/section_interface.rs | 1 + src/section_runner.rs | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/model/section.rs b/src/model/section.rs index 5f1be98..aba7592 100644 --- a/src/model/section.rs +++ b/src/model/section.rs @@ -18,6 +18,7 @@ impl Section { }) } + #[allow(dead_code)] pub fn as_sql(&self) -> Vec<&dyn ToSql> { vec![&self.id, &self.name, &self.interface_id] } diff --git a/src/section_interface.rs b/src/section_interface.rs index b004594..91a5c13 100644 --- a/src/section_interface.rs +++ b/src/section_interface.rs @@ -15,6 +15,7 @@ pub struct MockSectionInterface { } impl MockSectionInterface { + #[allow(dead_code)] pub fn new(num_sections: SectionId) -> Self { Self { states: repeat_with(|| AtomicBool::new(false)) diff --git a/src/section_runner.rs b/src/section_runner.rs index 04bbd19..8fc0a46 100644 --- a/src/section_runner.rs +++ b/src/section_runner.rs @@ -76,6 +76,7 @@ impl SecRun { self.start_time.map(|t| t.elapsed()) } + #[allow(dead_code)] fn is_done(&self) -> Option { self.elapsed().map(|elapsed| elapsed >= self.duration) } @@ -210,6 +211,7 @@ pub struct SectionRunner { msg_send: mpsc::Sender, } +#[allow(dead_code)] impl SectionRunner { pub fn new(interface: Arc) -> Self { let (msg_send, msg_recv) = mpsc::channel(8); @@ -326,7 +328,7 @@ mod test { async fn advance(dur: Duration) { // HACK: advance should really be enough, but we need another yield_now - tokio::time::advance(Duration::from_secs(10)).await; + tokio::time::advance(dur).await; tokio::task::yield_now().await; } @@ -393,7 +395,7 @@ mod test { .await .unwrap(); - let run2 = runner + let _run2 = runner .queue_run(sections[0].clone(), Duration::from_secs(10)) .await .unwrap();