Skip to content

Commit cdd8b30

Browse files
committed
used cargo fmt and clippy
1 parent b0d53e6 commit cdd8b30

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sentry/src/db.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ pub mod redis_pool {
164164
connections: DashMap<u8, Option<Database>>,
165165
}
166166

167+
impl Default for Manager {
168+
fn default() -> Self {
169+
Self::new()
170+
}
171+
}
172+
167173
impl Manager {
168174
/// The maximum databases that Redis has by default is 16, with DB `0` as default.
169175
const CONNECTIONS: u8 = 16;
@@ -237,7 +243,7 @@ pub mod redis_pool {
237243
// run `FLUSHDB` to clean any leftovers of previous tests
238244
Self::flush_db(&mut database.connection)
239245
.await
240-
.map_err(|err| RecycleError::Backend(err))?;
246+
.map_err(RecycleError::Backend)?;
241247
database.available = true;
242248

243249
Ok(())

sentry/src/middleware/auth.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,25 +127,20 @@ fn get_request_ip(req: &Request<Body>) -> Option<String> {
127127

128128
#[cfg(test)]
129129
mod test {
130-
use hyper::Request;
131130
use adapter::DummyAdapter;
131+
use hyper::Request;
132132
use primitives::adapter::DummyAdapterOptions;
133133

134134
use primitives::util::tests::prep_db::{AUTH, IDS};
135135

136-
137-
use primitives::{
138-
config::configuration,
139-
Config,
140-
};
136+
use primitives::{config::configuration};
141137

142138
use deadpool::managed::Object;
143139

144140
use crate::{
145141
db::redis_pool::{Database, TESTS_POOL},
146142
Session,
147143
};
148-
use std::env;
149144

150145
use super::*;
151146

@@ -157,7 +152,6 @@ mod test {
157152
dummy_auth_tokens: AUTH.clone(),
158153
};
159154
let config = configuration("development", None).expect("Dev config should be available");
160-
let url = env::var("REDIS_URL").unwrap_or_else(|_| String::from("redis://127.0.0.1:6379"));
161155

162156
(DummyAdapter::init(adapter_options, &config), connection)
163157
}

0 commit comments

Comments
 (0)