Skip to content

Commit b5ab815

Browse files
authored
Updated PR CI to run fmt and clippy (#68)
* Updated PR CI to run fmt and clippy * Formatting
1 parent f588e20 commit b5ab815

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ jobs:
2929
CARGO_MAKE_CLIPPY_ARGS = "--all-features -- -D warnings"
3030
CARGO_MAKE_RUN_CHECK_FORMAT = true
3131
RUSTFLAGS="-D warnings"
32+
33+
[tasks.check-format-ci-flow]
34+
condition = { env_set = [
35+
"CARGO_MAKE_RUN_CHECK_FORMAT",
36+
], channels = [
37+
"stable",
38+
], platforms = [
39+
"linux",
40+
] }
41+
42+
[tasks.clippy-ci-flow]
43+
condition = { env_set = [
44+
"CARGO_MAKE_RUN_CLIPPY",
45+
], channels = [
46+
"stable",
47+
], platforms = [
48+
"linux",
49+
] }
3250
EOF
3351
3452
- uses: actions-rs/cargo@v1

src/signal.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ impl Code {
276276
c_bindings::code_e_CODE_AUX_GAL => Ok(Code::AuxGal),
277277
c_bindings::code_e_CODE_AUX_QZS => Ok(Code::AuxQzs),
278278
c_bindings::code_e_CODE_AUX_BDS => Ok(Code::AuxBds),
279-
_ => {
280-
Err(InvalidCode(value))
281-
}
279+
_ => Err(InvalidCode(value)),
282280
}
283281
}
284282

src/time.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,13 @@ mod tests {
12441244
use chrono::prelude::*;
12451245
let epsilon = std::time::Duration::from_secs_f64(1e-6);
12461246
let swift_date = UtcTime::from_date(2021, 8, 1, 00, 11, 0.0);
1247-
let expected_utc = DateTime::<Utc>::from_utc(NaiveDateTime::new(NaiveDate::from_ymd(2021, 8, 1), NaiveTime::from_hms_nano(00, 11, 0, 0)), Utc);
1247+
let expected_utc = DateTime::<Utc>::from_utc(
1248+
NaiveDateTime::new(
1249+
NaiveDate::from_ymd(2021, 8, 1),
1250+
NaiveTime::from_hms_nano(00, 11, 0, 0),
1251+
),
1252+
Utc,
1253+
);
12481254

12491255
let converted: DateTime<Utc> = swift_date.clone().into();
12501256
assert!((converted - expected_utc).to_std().unwrap() < epsilon);

0 commit comments

Comments
 (0)