From 8477daa8b970ae8ef042a5242aee705003b63fc1 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 17 Apr 2019 15:25:51 +0200 Subject: Fix clippy warnings --- core/modules.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'core/modules.rs') diff --git a/core/modules.rs b/core/modules.rs index f46ff5d74..3c74fe11d 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -202,7 +202,7 @@ impl Future for RecursiveLoad { return Ok(Async::NotReady); } - let root_id = self.root_id.unwrap().clone(); + let root_id = self.root_id.unwrap(); let mut loader = self.take_loader(); let (isolate, modules) = loader.isolate_and_modules(); let result = { @@ -460,13 +460,10 @@ mod tests { fn poll(&mut self) -> Poll { self.counter += 1; - if self.url == "never_ready.js" { - // never_ready.js is never ready. + if self.url == "never_ready.js" + || (self.url == "slow.js" && self.counter < 2) + { return Ok(Async::NotReady); - } else if self.url == "slow.js" { - if self.counter < 2 { - return Ok(Async::NotReady); - } } match mock_source_code(&self.url) { Some(src) => Ok(Async::Ready(src.to_string())), @@ -560,7 +557,7 @@ mod tests { assert_eq!(modules.get_children(c_id), Some(&vec!["d.js".to_string()])); assert_eq!(modules.get_children(d_id), Some(&vec![])); } else { - assert!(false); + panic!("this shouldn't happen"); } } @@ -619,7 +616,7 @@ mod tests { ]) ); } else { - assert!(false); + panic!("this shouldn't happen"); } } -- cgit v1.2.3