diff --git a/src/async_utils.rs b/src/async_utils.rs index 84613b0..5580c30 100644 --- a/src/async_utils.rs +++ b/src/async_utils.rs @@ -52,7 +52,7 @@ impl Future for TimerFuture { }; *state = State::Completed; if let Some(w) = waker { - w.wake() + w.wake(); } }); } diff --git a/src/loggers.rs b/src/loggers.rs index dcbd0e1..1357173 100644 --- a/src/loggers.rs +++ b/src/loggers.rs @@ -21,19 +21,19 @@ pub trait Logger { where Self: Sized, { - self.writeln(3, msg) + self.writeln(3, msg); } fn debug + Into>(&self, msg: S) where Self: Sized, { - self.writeln(4, msg) + self.writeln(4, msg); } fn trace + Into>(&self, msg: S) where Self: Sized, { - self.writeln(5, msg) + self.writeln(5, msg); } fn put + Into>(&self, entries: impl IntoIterator>) -> usize where @@ -88,12 +88,12 @@ impl<'a, L> FilteringLogger<'a, L> { impl<'a, L: Logger> Logger for FilteringLogger<'a, L> { fn write + Into>(&self, level: Level, str: S) { if level <= self.max_level { - self.logger.write(level, str) + self.logger.write(level, str); } } fn writeln + Into>(&self, level: Level, str: S) { if level <= self.max_level { - self.logger.writeln(level, str) + self.logger.writeln(level, str); } } } diff --git a/src/setup/core.rs b/src/setup/core.rs index 3140e4c..4a640ea 100644 --- a/src/setup/core.rs +++ b/src/setup/core.rs @@ -33,7 +33,7 @@ macro_rules! add_generic { $name::Artifact: Clone ),* { - #[allow(unused)] + #[allow(unused, clippy::shadow_unrelated)] async fn add_generic(&self, ($($name,)*): ($($name,)*)) -> Result<(StoringLogger, ($($name::Artifact,)*), bool), (StoringLogger, Box)> { let ($($name,)*) = join!($(self.add($name, false),)*); diff --git a/src/setup/setup.rs b/src/setup/setup.rs index cad65cd..6d06eef 100644 --- a/src/setup/setup.rs +++ b/src/setup/setup.rs @@ -34,6 +34,8 @@ impl self.0.resources.borrow_mut() } + // FIXME: https://github.com/rust-lang/rust-clippy/issues/6353 + #[allow(clippy::await_holding_refcell_ref)] pub async fn add(&self, resource: R, force_run: bool) -> InternalAddResult where Rs: FromResource, diff --git a/src/setup/symbol_runner.rs b/src/setup/symbol_runner.rs index 378cd90..e9b3b10 100644 --- a/src/setup/symbol_runner.rs +++ b/src/setup/symbol_runner.rs @@ -101,6 +101,11 @@ impl SymbolRunner for DelayingSymbolRunner where R: SymbolRunner, { + #[allow( + clippy::cast_sign_loss, + clippy::cast_possible_truncation, + clippy::cast_precision_loss + )] async fn run_symbol( &self, symbol: &S, @@ -182,9 +187,9 @@ where logger.debug(format!("Running symbol {:?}", symbol)); let res = self.0.run_symbol(symbol, logger, force).await; if let Err(ref e) = res { - logger.info(format!("Failed on {:?} with {}, aborting.", symbol, e)) + logger.info(format!("Failed on {:?} with {}, aborting.", symbol, e)); } else { - logger.debug(format!("Successfully finished {:?}", symbol)) + logger.debug(format!("Successfully finished {:?}", symbol)); } res } diff --git a/src/symbols/systemd/user_service.rs b/src/symbols/systemd/user_service.rs index 9947f98..f795786 100644 --- a/src/symbols/systemd/user_service.rs +++ b/src/symbols/systemd/user_service.rs @@ -36,12 +36,11 @@ impl, U: AsRef, R: CommandRunner> UserService<'_, S, U, R> { let result = self.command_runner.run_with_args("systemctl", args).await?; if result.status.success() { return Ok(String::from_utf8(result.stdout)?.trim_end().to_string()); - } else { - let raw_stderr = String::from_utf8(result.stderr)?; - let stderr = raw_stderr.trim_end(); - if stderr != "Failed to connect to bus: No such file or directory" { - return Err(stderr.into()); - } + } + let raw_stderr = String::from_utf8(result.stderr)?; + let stderr = raw_stderr.trim_end(); + if stderr != "Failed to connect to bus: No such file or directory" { + return Err(stderr.into()); } tries -= 1; if tries == 0 { diff --git a/src/symbols/wordpress/translation.rs b/src/symbols/wordpress/translation.rs index 93b7344..6643c9e 100644 --- a/src/symbols/wordpress/translation.rs +++ b/src/symbols/wordpress/translation.rs @@ -53,7 +53,7 @@ impl, D: AsRef, R: CommandRunner> Translation<'_, C, D, R> { res.push(( format!("https://translate.wordpress.org/projects/wp/{}/{}{}/default/export-translations?format={}", version_x, in_slug, path_locale, format), [self.path.as_ref(), format!("{}{}.{}", out_slug, self.locale.as_ref(), format).as_ref()].iter().collect() - )) + )); } } res