Skip to content

Commit

Permalink
chore: Rust 1.81.0 linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Sep 6, 2024
1 parent e288487 commit f61fa2d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/app_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl AppEnv {
///
/// cargo watch -q -c -w src/ -x 'test env_ -- --nocapture'
#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[expect(clippy::unwrap_used)]
mod tests {
use super::*;

Expand Down
1 change: 0 additions & 1 deletion src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ impl Camera {

/// Convert a given u8 slice to a webp, update self info
/// Will execute the conversion on a spawn blocking tokio thread
#[allow(clippy::cognitive_complexity)]
async fn convert_to_webp(&mut self, buffer: &[u8]) {
let now = Instant::now();
if let Ok(mut image) = image::load_from_memory_with_format(buffer, image::ImageFormat::Jpeg)
Expand Down
3 changes: 0 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Only allow when debugging
// #![allow(unused)]

mod app_env;
mod app_error;
mod camera;
Expand Down
1 change: 0 additions & 1 deletion src/sysinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ impl SysInfo {
//
/// cargo watch -q -c -w src/ -x 'test sysinfo -- --test-threads=1 --nocapture'
#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use std::time::SystemTime;

Expand Down
2 changes: 0 additions & 2 deletions src/systemd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ fn get_user_name() -> Option<String> {
}

/// Check if unit file in systemd, and delete if true
#[allow(clippy::cognitive_complexity)]
fn uninstall_service(app_envs: &AppEnv) -> Result<(), AppError> {
if let Some(user_name) = get_user_name() {
let service = get_service_name();
Expand Down Expand Up @@ -112,7 +111,6 @@ WantedBy=multi-user.target
))
}
/// If is sudo, and able to get a user name (which isn't root), install leafcast as a service
#[allow(clippy::cognitive_complexity)]
fn install_service(app_envs: &AppEnv) -> Result<(), AppError> {
if let Some(user_name) = get_user_name() {
info!("Create service file");
Expand Down
12 changes: 6 additions & 6 deletions src/word_art/font.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[allow(unused)]
#[expect(unused)]
pub enum Color {
Blue,
BgRed,
Expand All @@ -21,7 +21,7 @@ impl Color {
}
}

#[allow(unused)]
#[expect(unused)]
pub enum FontName {
Block,
Colossal,
Expand All @@ -39,7 +39,7 @@ impl FontName {
}
}

#[allow(clippy::too_many_lines)]
#[expect(clippy::too_many_lines)]
const fn get_block() -> &'static str {
r"flf2a$ 7 7 13 0 7 0 64 0
Font Author: ?
Expand Down Expand Up @@ -765,7 +765,7 @@ impl FontName {
@@"
}

#[allow(clippy::too_many_lines)]
#[expect(clippy::too_many_lines)]
const fn get_roman() -> &'static str {
r#"flf2a$ 10 10 30 -1 7
Roman by Nick Miners N.M.Miners@durham.ac.uk
Expand Down Expand Up @@ -1797,7 +1797,7 @@ o888o Y8' $#
$#"#
}

#[allow(clippy::too_many_lines)]
#[expect(clippy::too_many_lines)]
const fn get_colossal() -> &'static str {
r#"flf2a$ 11 8 20 32 13
Colossal.flf (Jonathon - jon@mq.edu.au)
Expand Down Expand Up @@ -2938,7 +2938,7 @@ d88" "88b$ @
"#
}

#[allow(clippy::too_many_lines)]
#[expect(clippy::too_many_lines)]
const fn get_small() -> &'static str {
r"flf2a$ 5 4 13 15 10 0 22415
Small by Glenn Chappell 4/93 -- based on Standard
Expand Down
1 change: 0 additions & 1 deletion src/word_art/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ impl Intro {
///
/// cargo watch -q -c -w src/ -x 'test word_art -- --nocapture'
#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use crate::app_env::{EnvTimeZone, Rotation};

Expand Down
2 changes: 1 addition & 1 deletion src/ws/ws_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl WSSender {
})
}

#[allow(unused)]
#[expect(unused)]
/// restart application by force quitting, assuming running as service or in an auto-restart container
async fn restart(&self) {
self.close().await;
Expand Down
2 changes: 1 addition & 1 deletion src/ws_messages/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn to_struct(input: &str) -> Option<MessageValues> {
///
/// cargo watch -q -c -w src/ -x 'test message_incoming -- --test-threads=1 --nocapture'
#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[expect(clippy::unwrap_used)]
mod tests {
use super::*;

Expand Down

0 comments on commit f61fa2d

Please sign in to comment.