Skip to content

Commit

Permalink
Appease Clippy (redis-rs#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymell committed Feb 23, 2024
1 parent bb895c2 commit 45973d3
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 25 deletions.
1 change: 0 additions & 1 deletion redis-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
//! ```

use std::collections::VecDeque;
use std::iter::FromIterator;
use std::sync::{Arc, Mutex};

use redis::{Cmd, ConnectionLike, ErrorKind, Pipeline, RedisError, RedisResult, Value};
Expand Down
2 changes: 1 addition & 1 deletion redis/examples/async-multiplexed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use futures::{future, prelude::*};
use futures::prelude::*;
use redis::{aio::MultiplexedConnection, RedisResult};

async fn test_cmd(con: &MultiplexedConnection, i: i32) -> RedisResult<()> {
Expand Down
2 changes: 1 addition & 1 deletion redis/examples/basic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use redis::{self, transaction, Commands};
use redis::{transaction, Commands};

use std::collections::HashMap;
use std::env;
Expand Down
2 changes: 1 addition & 1 deletion redis/src/aio/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
};
#[cfg(all(not(feature = "tokio-comp"), feature = "async-std-comp"))]
use ::async_std::net::ToSocketAddrs;
use arc_swap::{self, ArcSwap};
use arc_swap::ArcSwap;
use futures::{
future::{self, Shared},
FutureExt,
Expand Down
1 change: 0 additions & 1 deletion redis/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
//! ```
use std::cell::RefCell;
use std::collections::HashSet;
use std::iter::Iterator;
use std::str::FromStr;
use std::thread;
use std::time::Duration;
Expand Down
11 changes: 2 additions & 9 deletions redis/src/cluster_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
//! ```
use std::{
collections::HashMap,
fmt, io,
iter::Iterator,
marker::Unpin,
mem,
fmt, io, mem,
pin::Pin,
sync::{Arc, Mutex},
task::{self, Poll},
Expand All @@ -47,11 +44,7 @@ use crate::{

#[cfg(all(not(feature = "tokio-comp"), feature = "async-std-comp"))]
use crate::aio::{async_std::AsyncStd, RedisRuntime};
use futures::{
future::{self, BoxFuture},
prelude::*,
ready, stream,
};
use futures::{future::BoxFuture, prelude::*, ready};
use log::{trace, warn};
use pin_project_lite::pin_project;
use rand::{seq::IteratorRandom, thread_rng};
Expand Down
3 changes: 1 addition & 2 deletions redis/src/cluster_routing.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::cmp::min;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::iter::Iterator;

use rand::seq::SliceRandom;
use rand::thread_rng;
Expand Down Expand Up @@ -1044,7 +1043,7 @@ mod tests {
.arg("baz")
.arg("{bar}vaz");
let routing = RoutingInfo::for_routable(&original_cmd);
let expected = vec![vec![0], vec![1, 3], vec![2]];
let expected = [vec![0], vec![1, 3], vec![2]];

let mut indices: Vec<_> = match routing {
Some(RoutingInfo::MultiNode((MultipleNodeRoutingInfo::MultiSlot(vec), _))) => {
Expand Down
2 changes: 0 additions & 2 deletions redis/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use std::collections::{BTreeMap, BTreeSet};
use std::convert::From;
use std::default::Default;
use std::error;
use std::ffi::{CString, NulError};
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion redis/tests/test_async.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use futures::{future, prelude::*, StreamExt};
use futures::{prelude::*, StreamExt};
use redis::{
aio::{ConnectionLike, MultiplexedConnection},
cmd, AsyncCommands, ErrorKind, RedisResult,
Expand Down
2 changes: 1 addition & 1 deletion redis/tests/test_async_async_std.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use futures::{future, prelude::*};
use futures::prelude::*;

use crate::support::*;

Expand Down
4 changes: 0 additions & 4 deletions redis/tests/test_cluster_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::sync::{
};

use futures::prelude::*;
use futures::stream;
use once_cell::sync::Lazy;
use redis::{
aio::{ConnectionLike, MultiplexedConnection},
Expand All @@ -17,9 +16,6 @@ use redis::{
RedisError, RedisFuture, RedisResult, Script, Value,
};

#[cfg(feature = "tls-rustls")]
use support::build_single_client;

use crate::support::*;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion redis/tests/test_module_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod support;

use serde::Serialize;
// adds json! macro for quick json generation on the fly.
use serde_json::{self, json};
use serde_json::json;

const TEST_KEY: &str = "my_json";

Expand Down

0 comments on commit 45973d3

Please sign in to comment.