fix clippy warnings
This commit is contained in:
parent
1f00098687
commit
b92af896d4
3 changed files with 4 additions and 9 deletions
|
@ -85,7 +85,7 @@ impl Executor {
|
|||
|
||||
pub fn sleep(&mut self) {
|
||||
if self.sleep_period < self.max_sleep_period {
|
||||
self.sleep_period = self.sleep_period + self.sleep_step;
|
||||
self.sleep_period += self.sleep_step;
|
||||
}
|
||||
|
||||
thread::sleep(Duration::from_secs(self.sleep_period));
|
||||
|
|
|
@ -37,15 +37,11 @@ impl Postgres {
|
|||
|
||||
let url = match database_url {
|
||||
Some(string_url) => string_url,
|
||||
None => {
|
||||
let url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
|
||||
|
||||
url
|
||||
}
|
||||
None => env::var("DATABASE_URL").expect("DATABASE_URL must be set"),
|
||||
};
|
||||
|
||||
let connection =
|
||||
PgConnection::establish(&url).expect(&format!("Error connecting to {}", url));
|
||||
PgConnection::establish(&url).unwrap_or_else(|_| panic!("Error connecting to {}", url));
|
||||
|
||||
Self {
|
||||
connection,
|
||||
|
@ -85,7 +81,7 @@ impl Postgres {
|
|||
self.connection.transaction::<Option<Task>, Error, _>(|| {
|
||||
let found_task = self.fetch_task();
|
||||
|
||||
if let None = found_task {
|
||||
if found_task.is_none() {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ impl WorkerThread {
|
|||
|
||||
pub fn spawn_in_pool(name: String, restarts: u64) {
|
||||
let mut builder = thread::Builder::new().name(name.clone());
|
||||
builder = builder;
|
||||
|
||||
info!(
|
||||
"starting a worker thread {}, number of restarts {}",
|
||||
|
|
Loading…
Reference in a new issue