[INFO] crate chrono-english 0.1.4 is already in cache [INFO] extracting crate chrono-english 0.1.4 into work/ex/clippy-test-run/sources/stable/reg/chrono-english/0.1.4 [INFO] extracting crate chrono-english 0.1.4 into work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/chrono-english/0.1.4 [INFO] validating manifest of chrono-english-0.1.4 on toolchain stable [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] validating manifest of chrono-english-0.1.4 on toolchain stable+rustflags=-Dclippy::into_iter_on_array [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] started frobbing chrono-english-0.1.4 [INFO] finished frobbing chrono-english-0.1.4 [INFO] frobbed toml for chrono-english-0.1.4 written to work/ex/clippy-test-run/sources/stable/reg/chrono-english/0.1.4/Cargo.toml [INFO] started frobbing chrono-english-0.1.4 [INFO] finished frobbing chrono-english-0.1.4 [INFO] frobbed toml for chrono-english-0.1.4 written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/chrono-english/0.1.4/Cargo.toml [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] linting chrono-english-0.1.4 against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-6/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/reg/chrono-english/0.1.4:/opt/crater/workdir:ro,Z" "-v" "/mnt/big/crater/work/local/cargo-home:/opt/crater/cargo-home:ro,Z" "-v" "/mnt/big/crater/work/local/rustup-home:/opt/crater/rustup-home:ro,Z" "-e" "USER_ID=1000" "-e" "SOURCE_DIR=/opt/crater/workdir" "-e" "MAP_USER_ID=1000" "-e" "CARGO_TARGET_DIR=/opt/crater/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/crater/cargo-home" "-e" "RUSTUP_HOME=/opt/crater/rustup-home" "-w" "/opt/crater/workdir" "-m" "1536M" "--network" "none" "rustops/crates-build-env" "/opt/crater/cargo-home/bin/cargo" "+stable" "clippy" "--frozen" "--all" "--all-targets"` [INFO] [stdout] 2d49471dabad2dafe552caf22d9fae39f02ea902e5727d277dc8662ae108923f [INFO] running `"docker" "start" "-a" "2d49471dabad2dafe552caf22d9fae39f02ea902e5727d277dc8662ae108923f"` [INFO] [stderr] Checking lapp v0.3.1 [INFO] [stderr] Checking chrono-english v0.1.4 (/opt/crater/workdir) [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/parser.rs:327:25 [INFO] [stderr] | [INFO] [stderr] 327 | Ok(DateTimeSpec{date: date, time: time}) [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `date` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/parser.rs:327:37 [INFO] [stderr] | [INFO] [stderr] 327 | Ok(DateTimeSpec{date: date, time: time}) [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `time` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:40:19 [INFO] [stderr] | [INFO] [stderr] 40 | NamedDate{direct: direct, unit: unit} [INFO] [stderr] | ^^^^^^^^^^^^^^ help: replace it with: `direct` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:40:35 [INFO] [stderr] | [INFO] [stderr] 40 | NamedDate{direct: direct, unit: unit} [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `unit` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:95:35 [INFO] [stderr] | [INFO] [stderr] 95 | ByName::DayMonth(YearDate{direct: direct, day: d, month: m}) [INFO] [stderr] | ^^^^^^^^^^^^^^ help: replace it with: `direct` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:259:17 [INFO] [stderr] | [INFO] [stderr] 259 | Skip{unit: unit, skip: n} [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `unit` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:91:14 [INFO] [stderr] | [INFO] [stderr] 91 | } else // maybe next or last? [INFO] [stderr] | ______________^ [INFO] [stderr] 92 | | if let Some(d) = Direction::from_name(&name) { [INFO] [stderr] | |____________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::suspicious_else_formatting)] on by default [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:141:26 [INFO] [stderr] | [INFO] [stderr] 141 | } else [INFO] [stderr] | __________________________^ [INFO] [stderr] 142 | | if let Some(u) = time_unit(&name) { // '2 days' [INFO] [stderr] | |________________________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:165:26 [INFO] [stderr] | [INFO] [stderr] 165 | } else [INFO] [stderr] | __________________________^ [INFO] [stderr] 166 | | if name == "am" || name == "pm" { [INFO] [stderr] | |________________________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:222:10 [INFO] [stderr] | [INFO] [stderr] 222 | } else [INFO] [stderr] | __________^ [INFO] [stderr] 223 | | if let Some(ch) = tnext.as_ref().unwrap().as_char() { [INFO] [stderr] | |________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:269:10 [INFO] [stderr] | [INFO] [stderr] 269 | } else [INFO] [stderr] | __________^ [INFO] [stderr] 270 | | if name != "am" { [INFO] [stderr] | |________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/types.rs:64:6 [INFO] [stderr] | [INFO] [stderr] 64 | } else [INFO] [stderr] | ______^ [INFO] [stderr] 65 | | if date < base { [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this if statement can be collapsed [INFO] [stderr] --> src/types.rs:65:5 [INFO] [stderr] | [INFO] [stderr] 65 | / if date < base { [INFO] [stderr] 66 | | if direct == Direction::Next { [INFO] [stderr] 67 | | res = Some(1) [INFO] [stderr] 68 | | } [INFO] [stderr] 69 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::collapsible_if)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 65 | if date < base && direct == Direction::Next { [INFO] [stderr] 66 | res = Some(1) [INFO] [stderr] 67 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/types.rs:78:14 [INFO] [stderr] | [INFO] [stderr] 78 | } else [INFO] [stderr] | ______________^ [INFO] [stderr] 79 | | if let Some(mn) = month_name(s) { [INFO] [stderr] | |____________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this if-then-else expression returns a bool literal [INFO] [stderr] --> src/parser.rs:72:20 [INFO] [stderr] | [INFO] [stderr] 72 | let sign = if t.is_char() && t.as_char().unwrap() == '-' { [INFO] [stderr] | ____________________^ [INFO] [stderr] 73 | | true [INFO] [stderr] 74 | | } else { [INFO] [stderr] 75 | | false [INFO] [stderr] 76 | | }; [INFO] [stderr] | |_________^ help: you can reduce it to: `t.is_char() && t.as_char().unwrap() == '-'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_bool)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stderr] [INFO] [stderr] warning: casting u32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/parser.rs:238:17 [INFO] [stderr] | [INFO] [stderr] 238 | (res as i64)*if ch == '-' {-1} else {1} [INFO] [stderr] | ^^^^^^^^^^^^ help: try: `i64::from(res)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cast_lossless)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/parser.rs:327:25 [INFO] [stderr] | [INFO] [stderr] 327 | Ok(DateTimeSpec{date: date, time: time}) [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `date` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/parser.rs:327:37 [INFO] [stderr] | [INFO] [stderr] 327 | Ok(DateTimeSpec{date: date, time: time}) [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `time` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:40:19 [INFO] [stderr] | [INFO] [stderr] 40 | NamedDate{direct: direct, unit: unit} [INFO] [stderr] | ^^^^^^^^^^^^^^ help: replace it with: `direct` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:40:35 [INFO] [stderr] | [INFO] [stderr] 40 | NamedDate{direct: direct, unit: unit} [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `unit` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:95:35 [INFO] [stderr] | [INFO] [stderr] 95 | ByName::DayMonth(YearDate{direct: direct, day: d, month: m}) [INFO] [stderr] | ^^^^^^^^^^^^^^ help: replace it with: `direct` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/types.rs:259:17 [INFO] [stderr] | [INFO] [stderr] 259 | Skip{unit: unit, skip: n} [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `unit` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: identical conversion [INFO] [stderr] --> src/errors.rs:29:9 [INFO] [stderr] | [INFO] [stderr] 29 | Err(date_error(msg).into()) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `date_error(msg)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::identity_conversion)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion [INFO] [stderr] [INFO] [stderr] warning: use of `ok_or` followed by a function call [INFO] [stderr] --> src/errors.rs:50:14 [INFO] [stderr] | [INFO] [stderr] 50 | self.ok_or(date_error(msg)) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| date_error(msg))` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::or_fun_call)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:98:39 [INFO] [stderr] | [INFO] [stderr] 98 | pub fn to_date_time(self, base: DateTime, ts: TimeSpec, american: bool) -> Option> [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::wrong_self_convention)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: casting u32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:117:32 [INFO] [stderr] | [INFO] [stderr] 117 | let this_day = base.weekday().num_days_from_monday() as i64; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i64::from(base.weekday().num_days_from_monday())` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting u32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:118:32 [INFO] [stderr] | [INFO] [stderr] 118 | let that_day = nd.unit as i64; [INFO] [stderr] | ^^^^^^^^^^^^^^ help: try: `i64::from(nd.unit)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:122:44 [INFO] [stderr] | [INFO] [stderr] 122 | date = add_days(date,7*correct as i64)?; [INFO] [stderr] | ^^^^^^^^^^^^^^ help: try: `i64::from(correct)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:132:48 [INFO] [stderr] | [INFO] [stderr] 132 | date = add_days(date,7*correct as i64)?; [INFO] [stderr] | ^^^^^^^^^^^^^^ help: try: `i64::from(correct)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:164:34 [INFO] [stderr] | [INFO] [stderr] 164 | pub fn to_date(self, base: DateTime) -> Option> { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:188:39 [INFO] [stderr] | [INFO] [stderr] 188 | pub fn to_date_time(self, base: DateTime, ts: TimeSpec) -> Option> { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:192:39 [INFO] [stderr] | [INFO] [stderr] 192 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^ help: try: `i64::from(secs)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:192:53 [INFO] [stderr] | [INFO] [stderr] 192 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: try: `i64::from(self.skip)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:198:39 [INFO] [stderr] | [INFO] [stderr] 198 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^ help: try: `i64::from(secs)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:198:53 [INFO] [stderr] | [INFO] [stderr] 198 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: try: `i64::from(self.skip)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:263:39 [INFO] [stderr] | [INFO] [stderr] 263 | pub fn to_date_time(self, base: DateTime, ts: TimeSpec, american: bool) -> Option> [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:300:39 [INFO] [stderr] | [INFO] [stderr] 300 | pub fn to_date_time(self, d: Date) -> Option> { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:91:14 [INFO] [stderr] | [INFO] [stderr] 91 | } else // maybe next or last? [INFO] [stderr] | ______________^ [INFO] [stderr] 92 | | if let Some(d) = Direction::from_name(&name) { [INFO] [stderr] | |____________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::suspicious_else_formatting)] on by default [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:141:26 [INFO] [stderr] | [INFO] [stderr] 141 | } else [INFO] [stderr] | __________________________^ [INFO] [stderr] 142 | | if let Some(u) = time_unit(&name) { // '2 days' [INFO] [stderr] | |________________________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:165:26 [INFO] [stderr] | [INFO] [stderr] 165 | } else [INFO] [stderr] | __________________________^ [INFO] [stderr] 166 | | if name == "am" || name == "pm" { [INFO] [stderr] | |________________________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:222:10 [INFO] [stderr] | [INFO] [stderr] 222 | } else [INFO] [stderr] | __________^ [INFO] [stderr] 223 | | if let Some(ch) = tnext.as_ref().unwrap().as_char() { [INFO] [stderr] | |________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/parser.rs:269:10 [INFO] [stderr] | [INFO] [stderr] 269 | } else [INFO] [stderr] | __________^ [INFO] [stderr] 270 | | if name != "am" { [INFO] [stderr] | |________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/types.rs:64:6 [INFO] [stderr] | [INFO] [stderr] 64 | } else [INFO] [stderr] | ______^ [INFO] [stderr] 65 | | if date < base { [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this if statement can be collapsed [INFO] [stderr] --> src/types.rs:65:5 [INFO] [stderr] | [INFO] [stderr] 65 | / if date < base { [INFO] [stderr] 66 | | if direct == Direction::Next { [INFO] [stderr] 67 | | res = Some(1) [INFO] [stderr] 68 | | } [INFO] [stderr] 69 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::collapsible_if)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 65 | if date < base && direct == Direction::Next { [INFO] [stderr] 66 | res = Some(1) [INFO] [stderr] 67 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this is an `else if` but the formatting might hide it [INFO] [stderr] --> src/types.rs:78:14 [INFO] [stderr] | [INFO] [stderr] 78 | } else [INFO] [stderr] | ______________^ [INFO] [stderr] 79 | | if let Some(mn) = month_name(s) { [INFO] [stderr] | |____________^ [INFO] [stderr] | [INFO] [stderr] = note: to remove this lint, remove the `else` or remove the new line between `else` and `if` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stderr] [INFO] [stderr] warning: this if-then-else expression returns a bool literal [INFO] [stderr] --> src/parser.rs:72:20 [INFO] [stderr] | [INFO] [stderr] 72 | let sign = if t.is_char() && t.as_char().unwrap() == '-' { [INFO] [stderr] | ____________________^ [INFO] [stderr] 73 | | true [INFO] [stderr] 74 | | } else { [INFO] [stderr] 75 | | false [INFO] [stderr] 76 | | }; [INFO] [stderr] | |_________^ help: you can reduce it to: `t.is_char() && t.as_char().unwrap() == '-'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_bool)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stderr] [INFO] [stderr] warning: casting u32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/parser.rs:238:17 [INFO] [stderr] | [INFO] [stderr] 238 | (res as i64)*if ch == '-' {-1} else {1} [INFO] [stderr] | ^^^^^^^^^^^^ help: try: `i64::from(res)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cast_lossless)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: identical conversion [INFO] [stderr] --> src/errors.rs:29:9 [INFO] [stderr] | [INFO] [stderr] 29 | Err(date_error(msg).into()) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `date_error(msg)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::identity_conversion)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion [INFO] [stderr] [INFO] [stderr] warning: use of `ok_or` followed by a function call [INFO] [stderr] --> src/errors.rs:50:14 [INFO] [stderr] | [INFO] [stderr] 50 | self.ok_or(date_error(msg)) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| date_error(msg))` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::or_fun_call)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:98:39 [INFO] [stderr] | [INFO] [stderr] 98 | pub fn to_date_time(self, base: DateTime, ts: TimeSpec, american: bool) -> Option> [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::wrong_self_convention)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: casting u32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:117:32 [INFO] [stderr] | [INFO] [stderr] 117 | let this_day = base.weekday().num_days_from_monday() as i64; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i64::from(base.weekday().num_days_from_monday())` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting u32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:118:32 [INFO] [stderr] | [INFO] [stderr] 118 | let that_day = nd.unit as i64; [INFO] [stderr] | ^^^^^^^^^^^^^^ help: try: `i64::from(nd.unit)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:122:44 [INFO] [stderr] | [INFO] [stderr] 122 | date = add_days(date,7*correct as i64)?; [INFO] [stderr] | ^^^^^^^^^^^^^^ help: try: `i64::from(correct)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:132:48 [INFO] [stderr] | [INFO] [stderr] 132 | date = add_days(date,7*correct as i64)?; [INFO] [stderr] | ^^^^^^^^^^^^^^ help: try: `i64::from(correct)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:164:34 [INFO] [stderr] | [INFO] [stderr] 164 | pub fn to_date(self, base: DateTime) -> Option> { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:188:39 [INFO] [stderr] | [INFO] [stderr] 188 | pub fn to_date_time(self, base: DateTime, ts: TimeSpec) -> Option> { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:192:39 [INFO] [stderr] | [INFO] [stderr] 192 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^ help: try: `i64::from(secs)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:192:53 [INFO] [stderr] | [INFO] [stderr] 192 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: try: `i64::from(self.skip)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:198:39 [INFO] [stderr] | [INFO] [stderr] 198 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^ help: try: `i64::from(secs)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting i32 to i64 may become silently lossy if types change [INFO] [stderr] --> src/types.rs:198:53 [INFO] [stderr] | [INFO] [stderr] 198 | Duration::seconds((secs as i64)*(self.skip as i64)) [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: try: `i64::from(self.skip)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:263:39 [INFO] [stderr] | [INFO] [stderr] 263 | pub fn to_date_time(self, base: DateTime, ts: TimeSpec, american: bool) -> Option> [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name [INFO] [stderr] --> src/types.rs:300:39 [INFO] [stderr] | [INFO] [stderr] 300 | pub fn to_date_time(self, d: Date) -> Option> { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 33 [INFO] [stderr] --> src/lib.rs:119:5 [INFO] [stderr] | [INFO] [stderr] 119 | / fn basics() { [INFO] [stderr] 120 | | let base = parse_date_string("2018-03-21 11:00",Utc::now(),Dialect::Uk).unwrap(); [INFO] [stderr] 121 | | [INFO] [stderr] 122 | | // Day of week - relative to today. May have a time part [INFO] [stderr] ... | [INFO] [stderr] 172 | | [INFO] [stderr] 173 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 3.09s [INFO] running `"docker" "inspect" "2d49471dabad2dafe552caf22d9fae39f02ea902e5727d277dc8662ae108923f"` [INFO] running `"docker" "rm" "-f" "2d49471dabad2dafe552caf22d9fae39f02ea902e5727d277dc8662ae108923f"` [INFO] [stdout] 2d49471dabad2dafe552caf22d9fae39f02ea902e5727d277dc8662ae108923f