Alyssa Ross: 3 Fix some trivial warnings Fix some trivial warnings Fix some trivial warnings 15 files changed, 13 insertions(+), 21 deletions(-)
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.sr.ht/~qaul/community/patches/20722/mbox | git am -3Learn more about email & git
These were either unused imports or variables that did not need to be mutable. --- libqaul/types/src/rpc/tests.rs | 3 --- netmods/netmod-tcp/src/lib.rs | 2 +- ratman/configure/src/config.rs | 2 +- ratman/configure/src/lib.rs | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libqaul/types/src/rpc/tests.rs b/libqaul/types/src/rpc/tests.rs index 997f5e88..dff01737 100644 --- a/libqaul/types/src/rpc/tests.rs +++ b/libqaul/types/src/rpc/tests.rs @@ -1,9 +1,6 @@ #[cfg(test)] use super::*; -use crate::diff::ItemDiff; -use crate::users::{UserAuth, UserUpdate}; - #[test] fn create_user() { let cap = Capabilities::Users(UserCapabilities::Create { diff --git a/netmods/netmod-tcp/src/lib.rs b/netmods/netmod-tcp/src/lib.rs index 52d54cb8..6fc96cf7 100644 --- a/netmods/netmod-tcp/src/lib.rs +++ b/netmods/netmod-tcp/src/lib.rs @@ -99,7 +99,7 @@ impl Endpoint { for p in peers.into_iter() { if &p == "" && continue {} - let mut parts: Vec<_> = p.split(|x| x == ' ').collect(); + let parts: Vec<_> = p.split(|x| x == ' ').collect(); let _type = parts.get(1); let peer = match parts[0].parse().ok() { Some(s) => s, diff --git a/ratman/configure/src/config.rs b/ratman/configure/src/config.rs index 4464d03b..9167ae43 100644 --- a/ratman/configure/src/config.rs +++ b/ratman/configure/src/config.rs @@ -3,7 +3,7 @@ use async_std::task::block_on; use ratman::Router; use std::collections::BTreeMap; -use std::{net::SocketAddr, ops::Deref, sync::Arc}; +use std::{ops::Deref, sync::Arc}; pub type Id = usize; diff --git a/ratman/configure/src/lib.rs b/ratman/configure/src/lib.rs index f9602107..0151937e 100644 --- a/ratman/configure/src/lib.rs +++ b/ratman/configure/src/lib.rs @@ -12,7 +12,7 @@ pub use parser::parse_json; pub mod config; use config::{Endpoint, Id, Network, Params}; -use std::{collections::BTreeMap, net::SocketAddr}; +use std::collections::BTreeMap; /// A rust API builder equivalent of the json parser /// -- 2.30.0
These were either unused imports or variables that did not need to be mutable. I've also changed libqaul-types entire test module to only be built with tests, so every import in it doesn't have to be #[cfg(test)]! --- In v2, I've fixed an issue where the libqaul-types RPC tests would fail to build because they expected ItemDiff to have been imported by super. libqaul/types/src/rpc/mod.rs | 1 + libqaul/types/src/rpc/tests.rs | 5 +---- netmods/netmod-tcp/src/lib.rs | 2 +- ratman/configure/src/config.rs | 2 +- ratman/configure/src/lib.rs | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libqaul/types/src/rpc/mod.rs b/libqaul/types/src/rpc/mod.rs index f646ef5a..f1f9082b 100644 --- a/libqaul/types/src/rpc/mod.rs +++ b/libqaul/types/src/rpc/mod.rs @@ -10,6 +10,7 @@ // mod error; // mod users; +#[cfg(test)] mod tests; // pub use error::ConvertError; diff --git a/libqaul/types/src/rpc/tests.rs b/libqaul/types/src/rpc/tests.rs index 997f5e88..0d852c74 100644 --- a/libqaul/types/src/rpc/tests.rs +++ b/libqaul/types/src/rpc/tests.rs @@ -1,8 +1,5 @@ -#[cfg(test)] -use super::*; - use crate::diff::ItemDiff; -use crate::users::{UserAuth, UserUpdate}; +use super::*; #[test] fn create_user() { diff --git a/netmods/netmod-tcp/src/lib.rs b/netmods/netmod-tcp/src/lib.rs index 52d54cb8..6fc96cf7 100644 --- a/netmods/netmod-tcp/src/lib.rs +++ b/netmods/netmod-tcp/src/lib.rs @@ -99,7 +99,7 @@ impl Endpoint { for p in peers.into_iter() { if &p == "" && continue {} - let mut parts: Vec<_> = p.split(|x| x == ' ').collect(); + let parts: Vec<_> = p.split(|x| x == ' ').collect(); let _type = parts.get(1); let peer = match parts[0].parse().ok() { Some(s) => s, diff --git a/ratman/configure/src/config.rs b/ratman/configure/src/config.rs index 4464d03b..9167ae43 100644 --- a/ratman/configure/src/config.rs +++ b/ratman/configure/src/config.rs @@ -3,7 +3,7 @@ use async_std::task::block_on; use ratman::Router; use std::collections::BTreeMap; -use std::{net::SocketAddr, ops::Deref, sync::Arc}; +use std::{ops::Deref, sync::Arc}; pub type Id = usize; diff --git a/ratman/configure/src/lib.rs b/ratman/configure/src/lib.rs index f9602107..0151937e 100644 --- a/ratman/configure/src/lib.rs +++ b/ratman/configure/src/lib.rs @@ -12,7 +12,7 @@ pub use parser::parse_json; pub mod config; use config::{Endpoint, Id, Network, Params}; -use std::{collections::BTreeMap, net::SocketAddr}; +use std::collections::BTreeMap; /// A rust API builder equivalent of the json parser /// -- 2.30.0
These were either unused imports or variables that did not need to be mutable. I've also changed libqaul-types entire test module to only be built with tests, so every import in it doesn't have to be #[cfg(test)]! --- v3: found the one in ratman/tests/announce.rs. I must have run cargo check without --tests before. libqaul/types/src/rpc/mod.rs | 1 + libqaul/types/src/rpc/tests.rs | 5 +---- netmods/netmod-tcp/src/lib.rs | 2 +- ratman/configure/src/config.rs | 2 +- ratman/configure/src/lib.rs | 2 +- ratman/tests/announce.rs | 1 - 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libqaul/types/src/rpc/mod.rs b/libqaul/types/src/rpc/mod.rs index f646ef5a..f1f9082b 100644 --- a/libqaul/types/src/rpc/mod.rs +++ b/libqaul/types/src/rpc/mod.rs @@ -10,6 +10,7 @@ // mod error; // mod users; +#[cfg(test)] mod tests; // pub use error::ConvertError; diff --git a/libqaul/types/src/rpc/tests.rs b/libqaul/types/src/rpc/tests.rs index 997f5e88..0d852c74 100644 --- a/libqaul/types/src/rpc/tests.rs +++ b/libqaul/types/src/rpc/tests.rs @@ -1,8 +1,5 @@ -#[cfg(test)] -use super::*; - use crate::diff::ItemDiff; -use crate::users::{UserAuth, UserUpdate}; +use super::*; #[test] fn create_user() { diff --git a/netmods/netmod-tcp/src/lib.rs b/netmods/netmod-tcp/src/lib.rs index 52d54cb8..6fc96cf7 100644 --- a/netmods/netmod-tcp/src/lib.rs +++ b/netmods/netmod-tcp/src/lib.rs @@ -99,7 +99,7 @@ impl Endpoint { for p in peers.into_iter() { if &p == "" && continue {} - let mut parts: Vec<_> = p.split(|x| x == ' ').collect(); + let parts: Vec<_> = p.split(|x| x == ' ').collect(); let _type = parts.get(1); let peer = match parts[0].parse().ok() { Some(s) => s, diff --git a/ratman/configure/src/config.rs b/ratman/configure/src/config.rs index 4464d03b..9167ae43 100644 --- a/ratman/configure/src/config.rs +++ b/ratman/configure/src/config.rs @@ -3,7 +3,7 @@ use async_std::task::block_on; use ratman::Router; use std::collections::BTreeMap; -use std::{net::SocketAddr, ops::Deref, sync::Arc}; +use std::{ops::Deref, sync::Arc}; pub type Id = usize; diff --git a/ratman/configure/src/lib.rs b/ratman/configure/src/lib.rs index f9602107..0151937e 100644 --- a/ratman/configure/src/lib.rs +++ b/ratman/configure/src/lib.rs @@ -12,7 +12,7 @@ pub use parser::parse_json; pub mod config; use config::{Endpoint, Id, Network, Params}; -use std::{collections::BTreeMap, net::SocketAddr}; +use std::collections::BTreeMap; /// A rust API builder equivalent of the json parser /// diff --git a/ratman/tests/announce.rs b/ratman/tests/announce.rs index 085eba5e..fa077a34 100644 --- a/ratman/tests/announce.rs +++ b/ratman/tests/announce.rs @@ -12,7 +12,6 @@ //! Because a `MemMod` is always 1-to-1, we need to create two, and //! then add two interfaces to the middle router. -use async_std::task; use netmod_mem::MemMod; use ratman::{Identity, Result, Router}; -- 2.30.0