From 0a94e805048d9b1a5047fa8286ef756a39ba8e32 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 14 Jun 2022 17:09:44 +0800 Subject: [PATCH] fix warnings --- services/shellchat/Cargo.toml | 5 ++++- services/shellchat/src/cmds/net_cmd.rs | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/services/shellchat/Cargo.toml b/services/shellchat/Cargo.toml index 51d82bdc6..6807e4ef2 100644 --- a/services/shellchat/Cargo.toml +++ b/services/shellchat/Cargo.toml @@ -62,6 +62,9 @@ threadpool = "1.8.1" # a *lot* of useful packages are chasing this devil. rand = {version = "0.8.5", features = ["getrandom"]} +# for ditherpunk testing +png = {version = "0.17.5", optional = true} + # for the curve25519 tests # hardware acceleration adaptations are inserted into a fork of the main branch. hex = {version = "0.4.3", default-features = false, features = []} @@ -92,5 +95,5 @@ benchmarks = [] # adds the benchmark routines. Left off normally to free up code aestests = [] # adds AES tests tts = [] # adds text to speech plugin pddbtest = [] -ditherpunk = [] +ditherpunk = ["png"] default = [] # "debugprint" diff --git a/services/shellchat/src/cmds/net_cmd.rs b/services/shellchat/src/cmds/net_cmd.rs index 850b29ce0..bfe296bf3 100644 --- a/services/shellchat/src/cmds/net_cmd.rs +++ b/services/shellchat/src/cmds/net_cmd.rs @@ -17,9 +17,7 @@ use dns::Dns; // necessary to work around https://github.com/rust-lang/rust/issu #[cfg(feature="ditherpunk")] use std::str::FromStr; #[cfg(feature="ditherpunk")] -use std::convert::TryInto; - -use gam::{Img, RGB}; +use gam::Img; pub struct NetCmd { callback_id: Option, @@ -368,7 +366,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd { let mut buf = vec![0; reader.output_buffer_size()]; let info = reader.next_frame(&mut buf).expect("failed to decode png"); - let (width, height) = (info.width, info.height); + let (width, _height) = (info.width, info.height); let img = Img::new(buf, width as usize); modals.show_image(&img).expect("show image modal failed");