Skip to content

Commit 61405c2

Browse files
committed
Rustfmt
1 parent de8b088 commit 61405c2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/sidekiq/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rand::{thread_rng, Rng};
1010
use serde::ser::SerializeStruct;
1111
use serde::{Serialize, Serializer};
1212

13-
use time::{OffsetDateTime, Duration};
13+
use time::{Duration, OffsetDateTime};
1414

1515
const REDIS_URL_ENV: &str = "REDIS_URL";
1616
const REDIS_URL_DEFAULT: &str = "redis://127.0.0.1/";
@@ -205,7 +205,11 @@ impl Client {
205205
let div: f64 = 1_000_f64;
206206
let maximum_target: f64 = 1_000_000_000_f64;
207207
let target_millsec: f64 = target_millsec_number / div;
208-
let now_millisec = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() as f64 / div;
208+
let now_millisec = SystemTime::now()
209+
.duration_since(UNIX_EPOCH)
210+
.unwrap()
211+
.as_secs() as f64
212+
/ div;
209213

210214
let start_at: f64 = if target_millsec < maximum_target {
211215
now_millisec + target_millsec

tests/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
88
use serde_json::value::Value;
99
use sidekiq::{create_redis_pool, Client, ClientOpts, Job};
1010

11-
use time::{OffsetDateTime, Duration};
11+
use time::{Duration, OffsetDateTime};
1212

1313
fn args() -> Vec<Value> {
1414
let value = json!({
@@ -129,7 +129,9 @@ fn test_client_perform_at() {
129129
let class = "MyClass".to_string();
130130
let job = Job::new(class, args(), Default::default());
131131
let client = get_client();
132-
let start_at = OffsetDateTime::now_utc().checked_add(Duration::HOUR).unwrap();
132+
let start_at = OffsetDateTime::now_utc()
133+
.checked_add(Duration::HOUR)
134+
.unwrap();
133135
match client.perform_at(start_at, job) {
134136
Ok(_) => {}
135137
Err(err) => {

0 commit comments

Comments
 (0)