[INFO] fetching crate lanis-rs 0.3.0... [INFO] linting lanis-rs-0.3.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate lanis-rs 0.3.0 into /workspace/builds/worker-6-tc1/source [INFO] started tweaking crates.io crate lanis-rs 0.3.0 [INFO] removed 0 missing examples [INFO] finished tweaking crates.io crate lanis-rs 0.3.0 [INFO] tweaked toml for crates.io crate lanis-rs 0.3.0 written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate lanis-rs 0.3.0 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate lanis-rs 0.3.0 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded reqwest_cookie_store v0.8.0 [INFO] [stderr] Downloaded stopwatch-rs v0.1.0 [INFO] [stderr] Downloaded quanta v0.10.1 [INFO] [stderr] Downloaded untis v0.3.0 [INFO] [stderr] Downloaded scraper v0.20.0 [INFO] [stderr] Downloaded async-compression v0.4.23 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 0e962a153c9ce3c79d70c0908aa5cf1af0565bec1a7a09f6685e1bf38c1af2d5 [INFO] running `Command { std: "docker" "start" "-a" "0e962a153c9ce3c79d70c0908aa5cf1af0565bec1a7a09f6685e1bf38c1af2d5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "0e962a153c9ce3c79d70c0908aa5cf1af0565bec1a7a09f6685e1bf38c1af2d5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0e962a153c9ce3c79d70c0908aa5cf1af0565bec1a7a09f6685e1bf38c1af2d5", kill_on_drop: false }` [INFO] [stdout] 0e962a153c9ce3c79d70c0908aa5cf1af0565bec1a7a09f6685e1bf38c1af2d5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 9cfe0ccfaaac582ed409d0100e63a2e681225a73e04aa01afe92264b9086cbb1 [INFO] running `Command { std: "docker" "start" "-a" "9cfe0ccfaaac582ed409d0100e63a2e681225a73e04aa01afe92264b9086cbb1", kill_on_drop: false }` [INFO] [stderr] Compiling zerocopy v0.8.25 [INFO] [stderr] Compiling cc v1.2.22 [INFO] [stderr] Compiling icu_properties_data v2.0.0 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Compiling getrandom v0.2.16 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Checking hashbrown v0.15.3 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling phf_shared v0.10.0 [INFO] [stderr] Checking base64ct v1.7.3 [INFO] [stderr] Checking flate2 v1.1.1 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking cookie v0.18.1 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling ahash v0.8.12 [INFO] [stderr] Compiling num-bigint-dig v0.8.4 [INFO] [stderr] Checking lazy_static v1.5.0 [INFO] [stderr] Checking phf v0.10.1 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking getrandom v0.3.3 [INFO] [stderr] Checking servo_arc v0.3.0 [INFO] [stderr] Checking pem-rfc7468 v0.7.0 [INFO] [stderr] Checking getopts v0.2.21 [INFO] [stderr] Checking raw-cpuid v10.7.0 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking signature v2.2.0 [INFO] [stderr] Checking ego-tree v0.6.3 [INFO] [stderr] Checking md-5 v0.10.6 [INFO] [stderr] Checking evpkdf v0.2.0 [INFO] [stderr] Checking der v0.7.10 [INFO] [stderr] Checking cbc v0.1.2 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Compiling openssl-sys v0.9.108 [INFO] [stderr] Checking num-iter v0.1.45 [INFO] [stderr] Checking spki v0.7.3 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking quanta v0.10.1 [INFO] [stderr] Compiling openssl v0.10.72 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Checking pkcs8 v0.10.2 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking stopwatch-rs v0.1.0 [INFO] [stderr] Checking pkcs1 v0.7.5 [INFO] [stderr] Checking rsa v0.9.8 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Compiling phf_generator v0.10.0 [INFO] [stderr] Compiling phf_codegen v0.11.3 [INFO] [stderr] Compiling string_cache_codegen v0.5.4 [INFO] [stderr] Compiling phf_codegen v0.10.0 [INFO] [stderr] Compiling selectors v0.25.0 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling markup5ever v0.12.1 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling phf_macros v0.11.3 [INFO] [stderr] Compiling html5ever v0.27.0 [INFO] [stderr] Compiling cssparser-macros v0.6.1 [INFO] [stderr] Compiling derive_more v0.99.20 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Checking phf v0.11.3 [INFO] [stderr] Checking cssparser v0.31.2 [INFO] [stderr] Checking tokio v1.45.0 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.0 [INFO] [stderr] Checking zerovec v0.11.2 [INFO] [stderr] Checking zerotrie v0.2.2 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking tinystr v0.8.1 [INFO] [stderr] Checking potential_utf v0.1.2 [INFO] [stderr] Checking icu_collections v2.0.0 [INFO] [stderr] Checking icu_locale_core v2.0.0 [INFO] [stderr] Checking icu_provider v2.0.0 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Checking icu_properties v2.0.0 [INFO] [stderr] Checking tokio-util v0.7.15 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking async-compression v0.4.23 [INFO] [stderr] Checking h2 v0.4.10 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking publicsuffix v2.3.0 [INFO] [stderr] Checking serde_json v1.0.140 [INFO] [stderr] Checking string_cache v0.8.9 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking cookie_store v0.21.1 [INFO] [stderr] Checking scraper v0.20.0 [INFO] [stderr] Checking hyper v1.6.0 [INFO] [stderr] Checking hyper-util v0.1.11 [INFO] [stderr] Checking hyper-tls v0.6.0 [INFO] [stderr] Checking reqwest v0.12.15 [INFO] [stderr] Checking reqwest_cookie_store v0.8.0 [INFO] [stderr] Checking untis v0.3.0 [INFO] [stderr] Checking lanis-rs v0.3.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `base::account` [INFO] [stdout] --> src/lib.rs:119:9 [INFO] [stdout] | [INFO] [stdout] 119 | use base::account; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `JsonConversation` is never constructed [INFO] [stdout] --> src/modules/messages.rs:312:24 [INFO] [stdout] | [INFO] [stdout] 312 | struct JsonConversation { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `JsonConversationMessage` is never constructed [INFO] [stdout] --> src/modules/messages.rs:322:24 [INFO] [stdout] | [INFO] [stdout] 322 | struct JsonConversationMessage { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/base/account.rs:431:9 [INFO] [stdout] | [INFO] [stdout] 431 | / if self.features.contains(&feature) { [INFO] [stdout] 432 | | true [INFO] [stdout] 433 | | } else { [INFO] [stdout] 434 | | false [INFO] [stdout] 435 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.features.contains(&feature)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base/schools.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | / if school.city == city { [INFO] [stdout] 17 | | if school.name == name { [INFO] [stdout] 18 | | return school.id; [INFO] [stdout] 19 | | } [INFO] [stdout] 20 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if school.city == city [INFO] [stdout] 17 ~ && school.name == name { [INFO] [stdout] 18 | return school.id; [INFO] [stdout] 19 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (18/7) [INFO] [stdout] --> src/modules/calendar.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | / pub fn new( [INFO] [stdout] 48 | | id: String, [INFO] [stdout] 49 | | school_id: Option, [INFO] [stdout] 50 | | external_uid: Option, [INFO] [stdout] ... | [INFO] [stdout] 65 | | all_day: bool, [INFO] [stdout] 66 | | ) -> Self { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/calendar.rs:317:81 [INFO] [stdout] | [INFO] [stdout] 317 | let json_study_group: JsonStudyGroup = serde_json::from_str(&json_object) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `json_object` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/file_storage.rs:46:21 [INFO] [stdout] | [INFO] [stdout] 46 | / match option { [INFO] [stdout] 47 | | Some(element) => { [INFO] [stdout] 48 | | Some(element.text().collect::().trim().to_string()) [INFO] [stdout] ... | [INFO] [stdout] 51 | | } [INFO] [stdout] | |_____________________^ help: try: `option.map(|element| element.text().collect::().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `chrono::DateTime` [INFO] [stdout] --> src/modules/file_storage.rs:205:33 [INFO] [stdout] | [INFO] [stdout] 205 | None => DateTime::from_timestamp_nanos(0).into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `DateTime::from_timestamp_nanos(0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/modules/file_storage.rs:229:18 [INFO] [stdout] | [INFO] [stdout] 229 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `JsonConversation` is never constructed [INFO] [stdout] --> src/modules/messages.rs:312:24 [INFO] [stdout] | [INFO] [stdout] 312 | struct JsonConversation { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `JsonConversationMessage` is never constructed [INFO] [stdout] --> src/modules/messages.rs:322:24 [INFO] [stdout] | [INFO] [stdout] 322 | struct JsonConversationMessage { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/modules/lessons.rs:251:29 [INFO] [stdout] | [INFO] [stdout] 251 | ... !element.is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `element.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `details` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:222:43 [INFO] [stdout] | [INFO] [stdout] 221 | if details.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = details` [INFO] [stdout] 222 | let details = details.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `homework_element` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:242:41 [INFO] [stdout] | [INFO] [stdout] 241 | if homework_element.is_some() { [INFO] [stdout] | ----------------------------- help: try: `if let Some() = homework_element` [INFO] [stdout] 242 | for text in homework_element.unwrap().text() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `open` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:334:44 [INFO] [stdout] | [INFO] [stdout] 333 | ... if open.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = open` [INFO] [stdout] 334 | ... let open = open.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `uploaded` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:409:50 [INFO] [stdout] | [INFO] [stdout] 408 | ... if uploaded.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = uploaded` [INFO] [stdout] 409 | ... Some(uploaded.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `uploaded` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:459:50 [INFO] [stdout] | [INFO] [stdout] 458 | ... if uploaded.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = uploaded` [INFO] [stdout] 459 | ... Some(uploaded.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `homework` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:527:38 [INFO] [stdout] | [INFO] [stdout] 526 | ... if homework.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = homework` [INFO] [stdout] 527 | ... Some(homework.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `attachments` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:541:33 [INFO] [stdout] | [INFO] [stdout] 540 | ... if attachments.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = attachments` [INFO] [stdout] 541 | ... attachments.unwrap().len() as i32 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `uploads` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:548:38 [INFO] [stdout] | [INFO] [stdout] 547 | ... if uploads.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = uploads` [INFO] [stdout] 548 | ... Some(uploads.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:359:37 [INFO] [stdout] | [INFO] [stdout] 359 | / ... match open.select(&upload_badge_selector).next() { [INFO] [stdout] 360 | | ... Some(element) => Some( [INFO] [stdout] 361 | | ... element.text().collect::().trim().to_string(), [INFO] [stdout] 362 | | ... ), [INFO] [stdout] 363 | | ... None => None, [INFO] [stdout] 364 | | ... } [INFO] [stdout] | |_______________________^ help: try: `open.select(&upload_badge_selector).next().map(|element| element.text().collect::().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:443:37 [INFO] [stdout] | [INFO] [stdout] 443 | / ... match closed.select(&upload_badge_selector).next() { [INFO] [stdout] 444 | | ... Some(element) => Some( [INFO] [stdout] 445 | | ... element.text().collect::().trim().to_string(), [INFO] [stdout] 446 | | ... ), [INFO] [stdout] 447 | | ... None => None, [INFO] [stdout] 448 | | ... } [INFO] [stdout] | |_______________________^ help: try: `closed.select(&upload_badge_selector).next().map(|element| element.text().collect::().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/modules/lessons.rs:624:44 [INFO] [stdout] | [INFO] [stdout] 624 | ... if let Some(_) = [INFO] [stdout] | _______________________- ^^^^^^^ [INFO] [stdout] 625 | | ... comment_element.select(&comment_info_selector).nth(0) [INFO] [stdout] | |_______________________________________________________________________________- help: try: `if comment_element.select(&comment_info_selector).nth(0).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/modules/lessons.rs:628:45 [INFO] [stdout] | [INFO] [stdout] 628 | / ... comment_element [INFO] [stdout] 629 | | ... .text() [INFO] [stdout] 630 | | ... .collect::() [INFO] [stdout] 631 | | ... .trim() [INFO] [stdout] 632 | | ... .to_string() [INFO] [stdout] 633 | | ... .split(':') [INFO] [stdout] | |_____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 628 ~ comment_element [INFO] [stdout] 629 + .text() [INFO] [stdout] 630 + .collect::() [INFO] [stdout] 631 + .trim().split(':') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/modules/lessons.rs:687:38 [INFO] [stdout] | [INFO] [stdout] 687 | ... let re = Regex::new(r"\s+\n").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/modules/lessons.rs:675:25 [INFO] [stdout] | [INFO] [stdout] 675 | for element in elements { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/modules/lessons.rs:722:41 [INFO] [stdout] | [INFO] [stdout] 722 | / ... if title == "Alle Leistungskontrolle(n)" { [INFO] [stdout] 723 | | ... true [INFO] [stdout] 724 | | ... } else { [INFO] [stdout] 725 | | ... false [INFO] [stdout] 726 | | ... } [INFO] [stdout] | |_______________________^ help: you can reduce it to: `title == "Alle Leistungskontrolle(n)"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/lessons.rs:807:27 [INFO] [stdout] | [INFO] [stdout] 807 | match element.select(&selector).nth(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `element.select(&selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/lessons.rs:807:42 [INFO] [stdout] | [INFO] [stdout] 807 | match element.select(&selector).nth(0) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `selector` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/modules/lessons.rs:828:21 [INFO] [stdout] | [INFO] [stdout] 828 | / if bool_select [INFO] [stdout] 829 | | .clone() [INFO] [stdout] 830 | | .nth(0) [INFO] [stdout] 831 | | .unwrap() [INFO] [stdout] ... | [INFO] [stdout] 839 | | false [INFO] [stdout] 840 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] help: you can reduce it to [INFO] [stdout] | [INFO] [stdout] 828 ~ bool_select [INFO] [stdout] 829 + .clone() [INFO] [stdout] 830 + .nth(0) [INFO] [stdout] 831 + .unwrap() [INFO] [stdout] 832 + .text() [INFO] [stdout] 833 + .collect::() [INFO] [stdout] 834 + .trim() == "erlaubt" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/modules/lessons.rs:846:29 [INFO] [stdout] | [INFO] [stdout] 846 | / ... if option.text().collect::().trim() == "erlaubt" { [INFO] [stdout] 847 | | ... true [INFO] [stdout] 848 | | ... } else { [INFO] [stdout] 849 | | ... false [INFO] [stdout] 850 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 845 ~ Some(option) [INFO] [stdout] 846 ~ if option.text().collect::().trim() == "erlaubt" => { [INFO] [stdout] 847 | true [INFO] [stdout] 848 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/modules/lessons.rs:846:29 [INFO] [stdout] | [INFO] [stdout] 846 | / ... if option.text().collect::().trim() == "erlaubt" { [INFO] [stdout] 847 | | ... true [INFO] [stdout] 848 | | ... } else { [INFO] [stdout] 849 | | ... false [INFO] [stdout] 850 | | ... } [INFO] [stdout] | |_______________________^ help: you can reduce it to: `option.text().collect::().trim() == "erlaubt"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/modules/lessons.rs:860:34 [INFO] [stdout] | [INFO] [stdout] 860 | let visibility = requirements [INFO] [stdout] | __________________________________^ [INFO] [stdout] 861 | | .select(&visibility_selector_0) [INFO] [stdout] 862 | | .nth(0) [INFO] [stdout] 863 | | .and_then(|e| Some(e.text().collect::().trim().to_string())) [INFO] [stdout] | |________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 860 ~ let visibility = requirements [INFO] [stdout] 861 + .select(&visibility_selector_0) [INFO] [stdout] 862 + .nth(0).map(|e| e.text().collect::().trim().to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/modules/lessons.rs:865:25 [INFO] [stdout] | [INFO] [stdout] 865 | / requirements [INFO] [stdout] 866 | | .select(&visibility_selector_1) [INFO] [stdout] 867 | | .nth(0) [INFO] [stdout] 868 | | .and_then(|e| Some(e.text().collect::().trim().to_string())) [INFO] [stdout] 869 | | .or_else(|| None) [INFO] [stdout] | |_____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 869 - .or_else(|| None) [INFO] [stdout] 869 + .or(None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/modules/lessons.rs:865:25 [INFO] [stdout] | [INFO] [stdout] 865 | / requirements [INFO] [stdout] 866 | | .select(&visibility_selector_1) [INFO] [stdout] 867 | | .nth(0) [INFO] [stdout] 868 | | .and_then(|e| Some(e.text().collect::().trim().to_string())) [INFO] [stdout] | |________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 865 ~ requirements [INFO] [stdout] 866 + .select(&visibility_selector_1) [INFO] [stdout] 867 + .nth(0).map(|e| e.text().collect::().trim().to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/base/account.rs:431:9 [INFO] [stdout] | [INFO] [stdout] 431 | / if self.features.contains(&feature) { [INFO] [stdout] 432 | | true [INFO] [stdout] 433 | | } else { [INFO] [stdout] 434 | | false [INFO] [stdout] 435 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.features.contains(&feature)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:909:21 [INFO] [stdout] | [INFO] [stdout] 909 | / match select_option_string(&extra_selector, &requirements).await { [INFO] [stdout] 910 | | Some(s) => Some(s.split("\n").nth(1).unwrap().trim().to_string()), [INFO] [stdout] 911 | | None => None, [INFO] [stdout] 912 | | } [INFO] [stdout] | |_____________________^ help: try: `select_option_string(&extra_selector, &requirements).await.map(|s| s.split("\n").nth(1).unwrap().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/lessons.rs:933:35 [INFO] [stdout] | [INFO] [stdout] 933 | .captures(&href) [INFO] [stdout] | ^^^^^ help: change this to: `href` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:947:33 [INFO] [stdout] | [INFO] [stdout] 947 | / ... match node.value().as_text() { [INFO] [stdout] 948 | | ... Some(text) => Some(text.trim().to_string()), [INFO] [stdout] 949 | | ... None => None, [INFO] [stdout] 950 | | ... } [INFO] [stdout] | |_______________________^ help: try: `node.value().as_text().map(|text| text.trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/modules/lessons.rs:972:17 [INFO] [stdout] | [INFO] [stdout] 972 | / match document.select(&upload_form_selector).nth(0) { [INFO] [stdout] 973 | | Some(form) => { [INFO] [stdout] 974 | | course_id = Some( [INFO] [stdout] 975 | | form.select(&course_id_selector) [INFO] [stdout] ... | [INFO] [stdout] 993 | | None => (), [INFO] [stdout] 994 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 972 ~ if let Some(form) = document.select(&upload_form_selector).nth(0) { [INFO] [stdout] 973 + course_id = Some( [INFO] [stdout] 974 + form.select(&course_id_selector) [INFO] [stdout] 975 + .nth(0) [INFO] [stdout] 976 + .unwrap() [INFO] [stdout] 977 + .attr("value") [INFO] [stdout] 978 + .unwrap() [INFO] [stdout] 979 + .parse::() [INFO] [stdout] 980 + .unwrap(), [INFO] [stdout] 981 + ); [INFO] [stdout] 982 + entry_id = Some( [INFO] [stdout] 983 + form.select(&entry_id_selector) [INFO] [stdout] 984 + .nth(0) [INFO] [stdout] 985 + .unwrap() [INFO] [stdout] 986 + .attr("value") [INFO] [stdout] 987 + .unwrap() [INFO] [stdout] 988 + .parse::() [INFO] [stdout] 989 + .unwrap(), [INFO] [stdout] 990 + ); [INFO] [stdout] 991 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/modules/lessons.rs:1001:17 [INFO] [stdout] | [INFO] [stdout] 1001 | / match document.select(&public_files_selector).nth(0) { [INFO] [stdout] 1002 | | Some(public_files_element) => { [INFO] [stdout] 1003 | | for element in public_files_element.select(&ul_ui_selector) { [INFO] [stdout] 1004 | | let a = element.select(&a_selector).nth(0).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 1038 | | None => (), [INFO] [stdout] 1039 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1001 ~ if let Some(public_files_element) = document.select(&public_files_selector).nth(0) { [INFO] [stdout] 1002 + for element in public_files_element.select(&ul_ui_selector) { [INFO] [stdout] 1003 + let a = element.select(&a_selector).nth(0).unwrap(); [INFO] [stdout] 1004 + let href = a.value().attr("href").unwrap(); [INFO] [stdout] 1005 + let name = a.text().collect::().trim().to_string(); [INFO] [stdout] 1006 + let url = format!("{}{}", URL::BASE, href); [INFO] [stdout] 1007 + let person = element [INFO] [stdout] 1008 + .select(&person_selector) [INFO] [stdout] 1009 + .nth(0) [INFO] [stdout] 1010 + .unwrap() [INFO] [stdout] 1011 + .text() [INFO] [stdout] 1012 + .collect::() [INFO] [stdout] 1013 + .trim() [INFO] [stdout] 1014 + .to_string(); [INFO] [stdout] 1015 + let index = file_index_re [INFO] [stdout] 1016 + .captures(&href) [INFO] [stdout] 1017 + .unwrap() [INFO] [stdout] 1018 + .get(1) [INFO] [stdout] 1019 + .unwrap() [INFO] [stdout] 1020 + .as_str() [INFO] [stdout] 1021 + .to_string() [INFO] [stdout] 1022 + .parse::() [INFO] [stdout] 1023 + .map_err(|_| { [INFO] [stdout] 1024 + Error::Parsing( [INFO] [stdout] 1025 + "Failed to parse index of file as i32".to_string(), [INFO] [stdout] 1026 + ) [INFO] [stdout] 1027 + })?; [INFO] [stdout] 1028 + [INFO] [stdout] 1029 + public_files.push(LessonUploadInfoPublicFile { [INFO] [stdout] 1030 + name, [INFO] [stdout] 1031 + url, [INFO] [stdout] 1032 + person, [INFO] [stdout] 1033 + index, [INFO] [stdout] 1034 + }) [INFO] [stdout] 1035 + } [INFO] [stdout] 1036 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/lessons.rs:1017:43 [INFO] [stdout] | [INFO] [stdout] 1017 | ... .captures(&href) [INFO] [stdout] | ^^^^^ help: change this to: `href` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/modules/lessons.rs:1046:31 [INFO] [stdout] | [INFO] [stdout] 1046 | let ymd = format!("{}", &s.split(" ").nth(2).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&s.split(" ").nth(2).unwrap()).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `files.get(0)` [INFO] [stdout] --> src/modules/lessons.rs:1128:23 [INFO] [stdout] | [INFO] [stdout] 1128 | match files.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `files.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/modules/lessons.rs:1251:18 [INFO] [stdout] | [INFO] [stdout] 1251 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/modules/lessons.rs:1274:25 [INFO] [stdout] | [INFO] [stdout] 1274 | let course_id = info.course_id.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.course_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/modules/lessons.rs:1275:24 [INFO] [stdout] | [INFO] [stdout] 1275 | let entry_id = info.entry_id.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.entry_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/modules/lessons.rs:1473:54 [INFO] [stdout] | [INFO] [stdout] 1473 | ... if lesson.url == course_url.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `course_url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base/schools.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | / if school.city == city { [INFO] [stdout] 17 | | if school.name == name { [INFO] [stdout] 18 | | return school.id; [INFO] [stdout] 19 | | } [INFO] [stdout] 20 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if school.city == city [INFO] [stdout] 17 ~ && school.name == name { [INFO] [stdout] 18 | return school.id; [INFO] [stdout] 19 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/modules/lessons.rs:1532:49 [INFO] [stdout] | [INFO] [stdout] 1532 | ... .lines() [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1533 | | ... .skip(1) [INFO] [stdout] 1534 | | ... .next() [INFO] [stdout] | |_____________________________^ help: use `nth` instead: `.nth(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/messages.rs:26:45 [INFO] [stdout] | [INFO] [stdout] 26 | let mut html = Html::parse_fragment(&html_string); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `html_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/messages.rs:46:45 [INFO] [stdout] | [INFO] [stdout] 46 | let mut html = Html::parse_fragment(&html_string); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `html_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (18/7) [INFO] [stdout] --> src/modules/calendar.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | / pub fn new( [INFO] [stdout] 48 | | id: String, [INFO] [stdout] 49 | | school_id: Option, [INFO] [stdout] 50 | | external_uid: Option, [INFO] [stdout] ... | [INFO] [stdout] 65 | | all_day: bool, [INFO] [stdout] 66 | | ) -> Self { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/messages.rs:163:85 [INFO] [stdout] | [INFO] [stdout] 163 | ... result.push(ConversationOverview::parse_participant(&receiver)?); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `receiver` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/calendar.rs:317:81 [INFO] [stdout] | [INFO] [stdout] 317 | let json_study_group: JsonStudyGroup = serde_json::from_str(&json_object) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `json_object` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/file_storage.rs:46:21 [INFO] [stdout] | [INFO] [stdout] 46 | / match option { [INFO] [stdout] 47 | | Some(element) => { [INFO] [stdout] 48 | | Some(element.text().collect::().trim().to_string()) [INFO] [stdout] ... | [INFO] [stdout] 51 | | } [INFO] [stdout] | |_____________________^ help: try: `option.map(|element| element.text().collect::().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/modules/messages.rs:656:9 [INFO] [stdout] | [INFO] [stdout] 656 | Ok(*self = ConversationOverview::get(&overview, client, key_pair).await?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 656 ~ let _: () = *self = ConversationOverview::get(&overview, client, key_pair).await?; [INFO] [stdout] 657 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JSON` contains a capitalized acronym [INFO] [stdout] --> src/modules/messages.rs:669:16 [INFO] [stdout] | [INFO] [stdout] 669 | struct JSON { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `chrono::DateTime` [INFO] [stdout] --> src/modules/file_storage.rs:205:33 [INFO] [stdout] | [INFO] [stdout] 205 | None => DateTime::from_timestamp_nanos(0).into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `DateTime::from_timestamp_nanos(0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.messages.get(0)` [INFO] [stdout] --> src/modules/messages.rs:680:31 [INFO] [stdout] | [INFO] [stdout] 680 | let sender_id = match self.messages.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `self.messages.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/modules/file_storage.rs:229:18 [INFO] [stdout] | [INFO] [stdout] 229 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/messages.rs:813:16 [INFO] [stdout] | [INFO] [stdout] 813 | Ok(html.select(&options_selector).nth(0).is_some()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `html.select(&options_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JSON` contains a capitalized acronym [INFO] [stdout] --> src/modules/messages.rs:849:20 [INFO] [stdout] | [INFO] [stdout] 849 | struct JSON { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/modules/timetable.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | / pub fn new( [INFO] [stdout] 52 | | status: LessonEntryStatus, [INFO] [stdout] 53 | | subjects: Vec, [INFO] [stdout] 54 | | teachers: Vec, [INFO] [stdout] ... | [INFO] [stdout] 60 | | substitution_text: Option, [INFO] [stdout] 61 | | ) -> Self { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/timetable.rs:109:53 [INFO] [stdout] | [INFO] [stdout] 109 | let document = Html::parse_document(&document_text); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `document_text` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:126:28 [INFO] [stdout] | [INFO] [stdout] 126 | let date = document [INFO] [stdout] | ____________________________^ [INFO] [stdout] 127 | | .select(&date_selector) [INFO] [stdout] 128 | | .nth(0) [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 126 ~ let date = document [INFO] [stdout] 127 + .select(&date_selector).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:170:52 [INFO] [stdout] | [INFO] [stdout] 170 | let start_time = get_time(&mut time_string.nth(0).unwrap().to_string()).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `time_string.next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:171:50 [INFO] [stdout] | [INFO] [stdout] 171 | let end_time = get_time(&mut time_string.nth(0).unwrap().to_string()).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `time_string.next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/modules/lessons.rs:251:29 [INFO] [stdout] | [INFO] [stdout] 251 | ... !element.is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `element.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `details` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:222:43 [INFO] [stdout] | [INFO] [stdout] 221 | if details.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = details` [INFO] [stdout] 222 | let details = details.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `homework_element` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:242:41 [INFO] [stdout] | [INFO] [stdout] 241 | if homework_element.is_some() { [INFO] [stdout] | ----------------------------- help: try: `if let Some() = homework_element` [INFO] [stdout] 242 | for text in homework_element.unwrap().text() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `open` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:334:44 [INFO] [stdout] | [INFO] [stdout] 333 | ... if open.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = open` [INFO] [stdout] 334 | ... let open = open.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `uploaded` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:409:50 [INFO] [stdout] | [INFO] [stdout] 408 | ... if uploaded.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = uploaded` [INFO] [stdout] 409 | ... Some(uploaded.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `uploaded` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:459:50 [INFO] [stdout] | [INFO] [stdout] 458 | ... if uploaded.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = uploaded` [INFO] [stdout] 459 | ... Some(uploaded.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `homework` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:527:38 [INFO] [stdout] | [INFO] [stdout] 526 | ... if homework.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = homework` [INFO] [stdout] 527 | ... Some(homework.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `attachments` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:541:33 [INFO] [stdout] | [INFO] [stdout] 540 | ... if attachments.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = attachments` [INFO] [stdout] 541 | ... attachments.unwrap().len() as i32 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `uploads` after checking its variant with `is_some` [INFO] [stdout] --> src/modules/lessons.rs:548:38 [INFO] [stdout] | [INFO] [stdout] 547 | ... if uploads.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = uploads` [INFO] [stdout] 548 | ... Some(uploads.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/modules/timetable.rs:260:44 [INFO] [stdout] | [INFO] [stdout] 260 | ... .get(&(school_hours.first().unwrap().clone() as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*school_hours.first().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/modules/timetable.rs:274:44 [INFO] [stdout] | [INFO] [stdout] 274 | ... .get(&(school_hours.last().unwrap().clone() as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*school_hours.last().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/timetable.rs:302:21 [INFO] [stdout] | [INFO] [stdout] 302 | / match document.select(&week_type_selector).nth(0) { [INFO] [stdout] 303 | | Some(week_type) => Some( [INFO] [stdout] 304 | | week_type [INFO] [stdout] 305 | | .text() [INFO] [stdout] ... | [INFO] [stdout] 313 | | None => None, [INFO] [stdout] 314 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 302 ~ document.select(&week_type_selector).nth(0).map(|week_type| week_type [INFO] [stdout] 303 + .text() [INFO] [stdout] 304 + .collect::() [INFO] [stdout] 305 + .trim() [INFO] [stdout] 306 + .to_string() [INFO] [stdout] 307 + .chars() [INFO] [stdout] 308 + .next() [INFO] [stdout] 309 + .unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:302:27 [INFO] [stdout] | [INFO] [stdout] 302 | match document.select(&week_type_selector).nth(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `document.select(&week_type_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/modules/timetable.rs:336:28 [INFO] [stdout] | [INFO] [stdout] 336 | if location == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `location.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:370:59 [INFO] [stdout] | [INFO] [stdout] 370 | ... LanisType::All => html.select(&all_selector).nth(0), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `html.select(&all_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:371:59 [INFO] [stdout] | [INFO] [stdout] 371 | ... LanisType::Own => html.select(&own_selector).nth(0), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `html.select(&own_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:359:37 [INFO] [stdout] | [INFO] [stdout] 359 | / ... match open.select(&upload_badge_selector).next() { [INFO] [stdout] 360 | | ... Some(element) => Some( [INFO] [stdout] 361 | | ... element.text().collect::().trim().to_string(), [INFO] [stdout] 362 | | ... ), [INFO] [stdout] 363 | | ... None => None, [INFO] [stdout] 364 | | ... } [INFO] [stdout] | |_______________________^ help: try: `open.select(&upload_badge_selector).next().map(|element| element.text().collect::().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:443:37 [INFO] [stdout] | [INFO] [stdout] 443 | / ... match closed.select(&upload_badge_selector).next() { [INFO] [stdout] 444 | | ... Some(element) => Some( [INFO] [stdout] 445 | | ... element.text().collect::().trim().to_string(), [INFO] [stdout] 446 | | ... ), [INFO] [stdout] 447 | | ... None => None, [INFO] [stdout] 448 | | ... } [INFO] [stdout] | |_______________________^ help: try: `closed.select(&upload_badge_selector).next().map(|element| element.text().collect::().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `URL` contains a capitalized acronym [INFO] [stdout] --> src/utils/constants.rs:2:12 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct URL; [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/modules/lessons.rs:624:44 [INFO] [stdout] | [INFO] [stdout] 624 | ... if let Some(_) = [INFO] [stdout] | _______________________- ^^^^^^^ [INFO] [stdout] 625 | | ... comment_element.select(&comment_info_selector).nth(0) [INFO] [stdout] | |_______________________________________________________________________________- help: try: `if comment_element.select(&comment_info_selector).nth(0).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/modules/lessons.rs:628:45 [INFO] [stdout] | [INFO] [stdout] 628 | / ... comment_element [INFO] [stdout] 629 | | ... .text() [INFO] [stdout] 630 | | ... .collect::() [INFO] [stdout] 631 | | ... .trim() [INFO] [stdout] 632 | | ... .to_string() [INFO] [stdout] 633 | | ... .split(':') [INFO] [stdout] | |_____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 628 ~ comment_element [INFO] [stdout] 629 + .text() [INFO] [stdout] 630 + .collect::() [INFO] [stdout] 631 + .trim().split(':') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/utils/conversion.rs:25:24 [INFO] [stdout] | [INFO] [stdout] 25 | let parts = string.trim().split_whitespace().collect::>(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `parts.get(0)` [INFO] [stdout] --> src/utils/conversion.rs:32:18 [INFO] [stdout] | [INFO] [stdout] 32 | let number = parts [INFO] [stdout] | __________________^ [INFO] [stdout] 33 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `parts.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/modules/lessons.rs:687:38 [INFO] [stdout] | [INFO] [stdout] 687 | ... let re = Regex::new(r"\s+\n").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/modules/lessons.rs:675:25 [INFO] [stdout] | [INFO] [stdout] 675 | for element in elements { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/modules/lessons.rs:722:41 [INFO] [stdout] | [INFO] [stdout] 722 | / ... if title == "Alle Leistungskontrolle(n)" { [INFO] [stdout] 723 | | ... true [INFO] [stdout] 724 | | ... } else { [INFO] [stdout] 725 | | ... false [INFO] [stdout] 726 | | ... } [INFO] [stdout] | |_______________________^ help: you can reduce it to: `title == "Alle Leistungskontrolle(n)"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `private_key_string` after checking its variant with `is_ok` [INFO] [stdout] --> src/utils/crypt.rs:45:42 [INFO] [stdout] | [INFO] [stdout] 44 | if private_key_string.is_ok() && public_key_string.is_ok() { [INFO] [stdout] | -------------------------- the check is happening here [INFO] [stdout] 45 | let private_key_string = private_key_string.unwrap().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `public_key_string` after checking its variant with `is_ok` [INFO] [stdout] --> src/utils/crypt.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 44 | if private_key_string.is_ok() && public_key_string.is_ok() { [INFO] [stdout] | ------------------------- the check is happening here [INFO] [stdout] 45 | let private_key_string = private_key_string.unwrap().to_string(); [INFO] [stdout] 46 | let public_key_string = public_key_string.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:76:37 [INFO] [stdout] | [INFO] [stdout] 76 | let public_key = get_public_key(&client).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/lessons.rs:807:27 [INFO] [stdout] | [INFO] [stdout] 807 | match element.select(&selector).nth(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `element.select(&selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/lessons.rs:807:42 [INFO] [stdout] | [INFO] [stdout] 807 | match element.select(&selector).nth(0) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `selector` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/modules/lessons.rs:828:21 [INFO] [stdout] | [INFO] [stdout] 828 | / if bool_select [INFO] [stdout] 829 | | .clone() [INFO] [stdout] 830 | | .nth(0) [INFO] [stdout] 831 | | .unwrap() [INFO] [stdout] ... | [INFO] [stdout] 839 | | false [INFO] [stdout] 840 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] help: you can reduce it to [INFO] [stdout] | [INFO] [stdout] 828 ~ bool_select [INFO] [stdout] 829 + .clone() [INFO] [stdout] 830 + .nth(0) [INFO] [stdout] 831 + .unwrap() [INFO] [stdout] 832 + .text() [INFO] [stdout] 833 + .collect::() [INFO] [stdout] 834 + .trim() == "erlaubt" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/modules/lessons.rs:846:29 [INFO] [stdout] | [INFO] [stdout] 846 | / ... if option.text().collect::().trim() == "erlaubt" { [INFO] [stdout] 847 | | ... true [INFO] [stdout] 848 | | ... } else { [INFO] [stdout] 849 | | ... false [INFO] [stdout] 850 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 845 ~ Some(option) [INFO] [stdout] 846 ~ if option.text().collect::().trim() == "erlaubt" => { [INFO] [stdout] 847 | true [INFO] [stdout] 848 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/modules/lessons.rs:846:29 [INFO] [stdout] | [INFO] [stdout] 846 | / ... if option.text().collect::().trim() == "erlaubt" { [INFO] [stdout] 847 | | ... true [INFO] [stdout] 848 | | ... } else { [INFO] [stdout] 849 | | ... false [INFO] [stdout] 850 | | ... } [INFO] [stdout] | |_______________________^ help: you can reduce it to: `option.text().collect::().trim() == "erlaubt"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/modules/lessons.rs:860:34 [INFO] [stdout] | [INFO] [stdout] 860 | let visibility = requirements [INFO] [stdout] | __________________________________^ [INFO] [stdout] 861 | | .select(&visibility_selector_0) [INFO] [stdout] 862 | | .nth(0) [INFO] [stdout] 863 | | .and_then(|e| Some(e.text().collect::().trim().to_string())) [INFO] [stdout] | |________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 860 ~ let visibility = requirements [INFO] [stdout] 861 + .select(&visibility_selector_0) [INFO] [stdout] 862 + .nth(0).map(|e| e.text().collect::().trim().to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/modules/lessons.rs:865:25 [INFO] [stdout] | [INFO] [stdout] 865 | / requirements [INFO] [stdout] 866 | | .select(&visibility_selector_1) [INFO] [stdout] 867 | | .nth(0) [INFO] [stdout] 868 | | .and_then(|e| Some(e.text().collect::().trim().to_string())) [INFO] [stdout] 869 | | .or_else(|| None) [INFO] [stdout] | |_____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 869 - .or_else(|| None) [INFO] [stdout] 869 + .or(None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/modules/lessons.rs:865:25 [INFO] [stdout] | [INFO] [stdout] 865 | / requirements [INFO] [stdout] 866 | | .select(&visibility_selector_1) [INFO] [stdout] 867 | | .nth(0) [INFO] [stdout] 868 | | .and_then(|e| Some(e.text().collect::().trim().to_string())) [INFO] [stdout] | |________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 865 ~ requirements [INFO] [stdout] 866 + .select(&visibility_selector_1) [INFO] [stdout] 867 + .nth(0).map(|e| e.text().collect::().trim().to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:909:21 [INFO] [stdout] | [INFO] [stdout] 909 | / match select_option_string(&extra_selector, &requirements).await { [INFO] [stdout] 910 | | Some(s) => Some(s.split("\n").nth(1).unwrap().trim().to_string()), [INFO] [stdout] 911 | | None => None, [INFO] [stdout] 912 | | } [INFO] [stdout] | |_____________________^ help: try: `select_option_string(&extra_selector, &requirements).await.map(|s| s.split("\n").nth(1).unwrap().trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/lessons.rs:933:35 [INFO] [stdout] | [INFO] [stdout] 933 | .captures(&href) [INFO] [stdout] | ^^^^^ help: change this to: `href` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/lessons.rs:947:33 [INFO] [stdout] | [INFO] [stdout] 947 | / ... match node.value().as_text() { [INFO] [stdout] 948 | | ... Some(text) => Some(text.trim().to_string()), [INFO] [stdout] 949 | | ... None => None, [INFO] [stdout] 950 | | ... } [INFO] [stdout] | |_______________________^ help: try: `node.value().as_text().map(|text| text.trim().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/modules/lessons.rs:972:17 [INFO] [stdout] | [INFO] [stdout] 972 | / match document.select(&upload_form_selector).nth(0) { [INFO] [stdout] 973 | | Some(form) => { [INFO] [stdout] 974 | | course_id = Some( [INFO] [stdout] 975 | | form.select(&course_id_selector) [INFO] [stdout] ... | [INFO] [stdout] 993 | | None => (), [INFO] [stdout] 994 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 972 ~ if let Some(form) = document.select(&upload_form_selector).nth(0) { [INFO] [stdout] 973 + course_id = Some( [INFO] [stdout] 974 + form.select(&course_id_selector) [INFO] [stdout] 975 + .nth(0) [INFO] [stdout] 976 + .unwrap() [INFO] [stdout] 977 + .attr("value") [INFO] [stdout] 978 + .unwrap() [INFO] [stdout] 979 + .parse::() [INFO] [stdout] 980 + .unwrap(), [INFO] [stdout] 981 + ); [INFO] [stdout] 982 + entry_id = Some( [INFO] [stdout] 983 + form.select(&entry_id_selector) [INFO] [stdout] 984 + .nth(0) [INFO] [stdout] 985 + .unwrap() [INFO] [stdout] 986 + .attr("value") [INFO] [stdout] 987 + .unwrap() [INFO] [stdout] 988 + .parse::() [INFO] [stdout] 989 + .unwrap(), [INFO] [stdout] 990 + ); [INFO] [stdout] 991 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/modules/lessons.rs:1001:17 [INFO] [stdout] | [INFO] [stdout] 1001 | / match document.select(&public_files_selector).nth(0) { [INFO] [stdout] 1002 | | Some(public_files_element) => { [INFO] [stdout] 1003 | | for element in public_files_element.select(&ul_ui_selector) { [INFO] [stdout] 1004 | | let a = element.select(&a_selector).nth(0).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 1038 | | None => (), [INFO] [stdout] 1039 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1001 ~ if let Some(public_files_element) = document.select(&public_files_selector).nth(0) { [INFO] [stdout] 1002 + for element in public_files_element.select(&ul_ui_selector) { [INFO] [stdout] 1003 + let a = element.select(&a_selector).nth(0).unwrap(); [INFO] [stdout] 1004 + let href = a.value().attr("href").unwrap(); [INFO] [stdout] 1005 + let name = a.text().collect::().trim().to_string(); [INFO] [stdout] 1006 + let url = format!("{}{}", URL::BASE, href); [INFO] [stdout] 1007 + let person = element [INFO] [stdout] 1008 + .select(&person_selector) [INFO] [stdout] 1009 + .nth(0) [INFO] [stdout] 1010 + .unwrap() [INFO] [stdout] 1011 + .text() [INFO] [stdout] 1012 + .collect::() [INFO] [stdout] 1013 + .trim() [INFO] [stdout] 1014 + .to_string(); [INFO] [stdout] 1015 + let index = file_index_re [INFO] [stdout] 1016 + .captures(&href) [INFO] [stdout] 1017 + .unwrap() [INFO] [stdout] 1018 + .get(1) [INFO] [stdout] 1019 + .unwrap() [INFO] [stdout] 1020 + .as_str() [INFO] [stdout] 1021 + .to_string() [INFO] [stdout] 1022 + .parse::() [INFO] [stdout] 1023 + .map_err(|_| { [INFO] [stdout] 1024 + Error::Parsing( [INFO] [stdout] 1025 + "Failed to parse index of file as i32".to_string(), [INFO] [stdout] 1026 + ) [INFO] [stdout] 1027 + })?; [INFO] [stdout] 1028 + [INFO] [stdout] 1029 + public_files.push(LessonUploadInfoPublicFile { [INFO] [stdout] 1030 + name, [INFO] [stdout] 1031 + url, [INFO] [stdout] 1032 + person, [INFO] [stdout] 1033 + index, [INFO] [stdout] 1034 + }) [INFO] [stdout] 1035 + } [INFO] [stdout] 1036 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/utils/crypt.rs:200:5 [INFO] [stdout] | [INFO] [stdout] 198 | let result = base64::Engine::encode(&base64::engine::general_purpose::STANDARD, encrypted); [INFO] [stdout] | ------------------------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 199 | [INFO] [stdout] 200 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 198 ~ [INFO] [stdout] 199 | [INFO] [stdout] 200 ~ base64::Engine::encode(&base64::engine::general_purpose::STANDARD, encrypted) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:188:67 [INFO] [stdout] | [INFO] [stdout] 188 | let encrypted = encryptor.encrypt_padded_vec_mut::(&data); [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/lessons.rs:1017:43 [INFO] [stdout] | [INFO] [stdout] 1017 | ... .captures(&href) [INFO] [stdout] | ^^^^^ help: change this to: `href` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/modules/lessons.rs:1046:31 [INFO] [stdout] | [INFO] [stdout] 1046 | let ymd = format!("{}", &s.split(" ").nth(2).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&s.split(" ").nth(2).unwrap()).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/crypt.rs:226:78 [INFO] [stdout] | [INFO] [stdout] 226 | match base64::Engine::decode(&base64::engine::general_purpose::STANDARD, &data) { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:228:56 [INFO] [stdout] | [INFO] [stdout] 228 | let result = decrypt_lanis_with_key(&data, &public_key).await?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `public_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/utils/crypt.rs:245:34 [INFO] [stdout] | [INFO] [stdout] 245 | fn is_salted(encrypted_data: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 245 - fn is_salted(encrypted_data: &Vec) -> bool { [INFO] [stdout] 245 + fn is_salted(encrypted_data: &[u8]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:252:19 [INFO] [stdout] | [INFO] [stdout] 252 | if !is_salted(&data) { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `files.get(0)` [INFO] [stdout] --> src/modules/lessons.rs:1128:23 [INFO] [stdout] | [INFO] [stdout] 1128 | match files.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `files.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/modules/lessons.rs:1251:18 [INFO] [stdout] | [INFO] [stdout] 1251 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/modules/lessons.rs:1274:25 [INFO] [stdout] | [INFO] [stdout] 1274 | let course_id = info.course_id.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.course_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/modules/lessons.rs:1275:24 [INFO] [stdout] | [INFO] [stdout] 1275 | let entry_id = info.entry_id.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.entry_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/modules/lessons.rs:1473:54 [INFO] [stdout] | [INFO] [stdout] 1473 | ... if lesson.url == course_url.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `course_url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/modules/lessons.rs:1532:49 [INFO] [stdout] | [INFO] [stdout] 1532 | ... .lines() [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1533 | | ... .skip(1) [INFO] [stdout] 1534 | | ... .next() [INFO] [stdout] | |_____________________________^ help: use `nth` instead: `.nth(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/messages.rs:26:45 [INFO] [stdout] | [INFO] [stdout] 26 | let mut html = Html::parse_fragment(&html_string); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `html_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/messages.rs:46:45 [INFO] [stdout] | [INFO] [stdout] 46 | let mut html = Html::parse_fragment(&html_string); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `html_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/messages.rs:163:85 [INFO] [stdout] | [INFO] [stdout] 163 | ... result.push(ConversationOverview::parse_participant(&receiver)?); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `receiver` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/modules/messages.rs:656:9 [INFO] [stdout] | [INFO] [stdout] 656 | Ok(*self = ConversationOverview::get(&overview, client, key_pair).await?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 656 ~ let _: () = *self = ConversationOverview::get(&overview, client, key_pair).await?; [INFO] [stdout] 657 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JSON` contains a capitalized acronym [INFO] [stdout] --> src/modules/messages.rs:669:16 [INFO] [stdout] | [INFO] [stdout] 669 | struct JSON { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.messages.get(0)` [INFO] [stdout] --> src/modules/messages.rs:680:31 [INFO] [stdout] | [INFO] [stdout] 680 | let sender_id = match self.messages.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `self.messages.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/messages.rs:813:16 [INFO] [stdout] | [INFO] [stdout] 813 | Ok(html.select(&options_selector).nth(0).is_some()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `html.select(&options_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JSON` contains a capitalized acronym [INFO] [stdout] --> src/modules/messages.rs:849:20 [INFO] [stdout] | [INFO] [stdout] 849 | struct JSON { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/modules/timetable.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | / pub fn new( [INFO] [stdout] 52 | | status: LessonEntryStatus, [INFO] [stdout] 53 | | subjects: Vec, [INFO] [stdout] 54 | | teachers: Vec, [INFO] [stdout] ... | [INFO] [stdout] 60 | | substitution_text: Option, [INFO] [stdout] 61 | | ) -> Self { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/modules/timetable.rs:109:53 [INFO] [stdout] | [INFO] [stdout] 109 | let document = Html::parse_document(&document_text); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `document_text` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:126:28 [INFO] [stdout] | [INFO] [stdout] 126 | let date = document [INFO] [stdout] | ____________________________^ [INFO] [stdout] 127 | | .select(&date_selector) [INFO] [stdout] 128 | | .nth(0) [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 126 ~ let date = document [INFO] [stdout] 127 + .select(&date_selector).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:170:52 [INFO] [stdout] | [INFO] [stdout] 170 | let start_time = get_time(&mut time_string.nth(0).unwrap().to_string()).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `time_string.next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:171:50 [INFO] [stdout] | [INFO] [stdout] 171 | let end_time = get_time(&mut time_string.nth(0).unwrap().to_string()).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `time_string.next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/modules/timetable.rs:260:44 [INFO] [stdout] | [INFO] [stdout] 260 | ... .get(&(school_hours.first().unwrap().clone() as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*school_hours.first().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/modules/timetable.rs:274:44 [INFO] [stdout] | [INFO] [stdout] 274 | ... .get(&(school_hours.last().unwrap().clone() as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*school_hours.last().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/modules/timetable.rs:302:21 [INFO] [stdout] | [INFO] [stdout] 302 | / match document.select(&week_type_selector).nth(0) { [INFO] [stdout] 303 | | Some(week_type) => Some( [INFO] [stdout] 304 | | week_type [INFO] [stdout] 305 | | .text() [INFO] [stdout] ... | [INFO] [stdout] 313 | | None => None, [INFO] [stdout] 314 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 302 ~ document.select(&week_type_selector).nth(0).map(|week_type| week_type [INFO] [stdout] 303 + .text() [INFO] [stdout] 304 + .collect::() [INFO] [stdout] 305 + .trim() [INFO] [stdout] 306 + .to_string() [INFO] [stdout] 307 + .chars() [INFO] [stdout] 308 + .next() [INFO] [stdout] 309 + .unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:302:27 [INFO] [stdout] | [INFO] [stdout] 302 | match document.select(&week_type_selector).nth(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `document.select(&week_type_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/modules/timetable.rs:336:28 [INFO] [stdout] | [INFO] [stdout] 336 | if location == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `location.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:370:59 [INFO] [stdout] | [INFO] [stdout] 370 | ... LanisType::All => html.select(&all_selector).nth(0), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `html.select(&all_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/modules/timetable.rs:371:59 [INFO] [stdout] | [INFO] [stdout] 371 | ... LanisType::Own => html.select(&own_selector).nth(0), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `html.select(&own_selector).next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `URL` contains a capitalized acronym [INFO] [stdout] --> src/utils/constants.rs:2:12 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct URL; [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/utils/conversion.rs:25:24 [INFO] [stdout] | [INFO] [stdout] 25 | let parts = string.trim().split_whitespace().collect::>(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `parts.get(0)` [INFO] [stdout] --> src/utils/conversion.rs:32:18 [INFO] [stdout] | [INFO] [stdout] 32 | let number = parts [INFO] [stdout] | __________________^ [INFO] [stdout] 33 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `parts.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `private_key_string` after checking its variant with `is_ok` [INFO] [stdout] --> src/utils/crypt.rs:45:42 [INFO] [stdout] | [INFO] [stdout] 44 | if private_key_string.is_ok() && public_key_string.is_ok() { [INFO] [stdout] | -------------------------- the check is happening here [INFO] [stdout] 45 | let private_key_string = private_key_string.unwrap().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `public_key_string` after checking its variant with `is_ok` [INFO] [stdout] --> src/utils/crypt.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 44 | if private_key_string.is_ok() && public_key_string.is_ok() { [INFO] [stdout] | ------------------------- the check is happening here [INFO] [stdout] 45 | let private_key_string = private_key_string.unwrap().to_string(); [INFO] [stdout] 46 | let public_key_string = public_key_string.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:76:37 [INFO] [stdout] | [INFO] [stdout] 76 | let public_key = get_public_key(&client).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/utils/crypt.rs:200:5 [INFO] [stdout] | [INFO] [stdout] 198 | let result = base64::Engine::encode(&base64::engine::general_purpose::STANDARD, encrypted); [INFO] [stdout] | ------------------------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 199 | [INFO] [stdout] 200 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 198 ~ [INFO] [stdout] 199 | [INFO] [stdout] 200 ~ base64::Engine::encode(&base64::engine::general_purpose::STANDARD, encrypted) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:188:67 [INFO] [stdout] | [INFO] [stdout] 188 | let encrypted = encryptor.encrypt_padded_vec_mut::(&data); [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils/crypt.rs:226:78 [INFO] [stdout] | [INFO] [stdout] 226 | match base64::Engine::decode(&base64::engine::general_purpose::STANDARD, &data) { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:228:56 [INFO] [stdout] | [INFO] [stdout] 228 | let result = decrypt_lanis_with_key(&data, &public_key).await?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `public_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/utils/crypt.rs:245:34 [INFO] [stdout] | [INFO] [stdout] 245 | fn is_salted(encrypted_data: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 245 - fn is_salted(encrypted_data: &Vec) -> bool { [INFO] [stdout] 245 + fn is_salted(encrypted_data: &[u8]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/crypt.rs:252:19 [INFO] [stdout] | [INFO] [stdout] 252 | if !is_salted(&data) { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> examples/messages.rs:274:41 [INFO] [stdout] | [INFO] [stdout] 274 | send_message(&conversation, &client, &lanis_key_pair).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> examples/messages.rs:274:50 [INFO] [stdout] | [INFO] [stdout] 274 | send_message(&conversation, &client, &lanis_key_pair).await; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `lanis_key_pair` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/lib.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | / let mut schools: Vec = vec![]; [INFO] [stdout] 148 | | schools.push(School { [INFO] [stdout] 149 | | id: 3120, [INFO] [stdout] 150 | | name: String::from("The Almighty Rust School"), [INFO] [stdout] ... | [INFO] [stdout] 161 | | city: String::from("Rust City"), [INFO] [stdout] 162 | | }); [INFO] [stdout] | |___________^ help: consider using the `vec![]` macro: `let schools: Vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `result.get(0)` [INFO] [stdout] --> src/lib.rs:172:20 [INFO] [stdout] | [INFO] [stdout] 172 | assert_eq!(result.get(0).unwrap().id, 3354); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `result.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `status.get(0)` [INFO] [stdout] --> src/lib.rs:403:57 [INFO] [stdout] | [INFO] [stdout] 403 | ... if file.name == status.get(0).unwrap().name { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `status.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `root_page.folder_nodes.get(0)` [INFO] [stdout] --> src/lib.rs:463:29 [INFO] [stdout] | [INFO] [stdout] 463 | if let Some(node) = root_page.folder_nodes.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `root_page.folder_nodes.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `first_page.file_nodes.get(0)` [INFO] [stdout] --> src/lib.rs:474:33 [INFO] [stdout] | [INFO] [stdout] 474 | if let Some(node) = first_page.file_nodes.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `first_page.file_nodes.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `uploads` [INFO] [stdout] --> examples/get_lessons.rs:148:27 [INFO] [stdout] | [INFO] [stdout] 148 | async fn interact_uploads(uploads: &Vec) { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_uploads` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/lib.rs:510:29 [INFO] [stdout] | [INFO] [stdout] 510 | for mut overview in overviews.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `overviews.iter().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/lib.rs:586:13 [INFO] [stdout] | [INFO] [stdout] 586 | assert_eq!(result.is_some(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 586 - assert_eq!(result.is_some(), true); [INFO] [stdout] 586 + assert!(result.is_some()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> examples/get_lessons.rs:148:36 [INFO] [stdout] | [INFO] [stdout] 148 | async fn interact_uploads(uploads: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 148 - async fn interact_uploads(uploads: &Vec) { [INFO] [stdout] 148 + async fn interact_uploads(uploads: &[LessonUpload]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> examples/get_lessons.rs:152:44 [INFO] [stdout] | [INFO] [stdout] 152 | async fn interact_attachments(attachments: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 152 - async fn interact_attachments(attachments: &Vec) { [INFO] [stdout] 152 + async fn interact_attachments(attachments: &[Attachment]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/lib.rs:620:17 [INFO] [stdout] | [INFO] [stdout] 620 | assert_eq!(result.is_some(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 620 - assert_eq!(result.is_some(), true); [INFO] [stdout] 620 + assert!(result.is_some()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 36.75s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: num-bigint-dig v0.8.4 [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 3` [INFO] running `Command { std: "docker" "inspect" "9cfe0ccfaaac582ed409d0100e63a2e681225a73e04aa01afe92264b9086cbb1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9cfe0ccfaaac582ed409d0100e63a2e681225a73e04aa01afe92264b9086cbb1", kill_on_drop: false }` [INFO] [stdout] 9cfe0ccfaaac582ed409d0100e63a2e681225a73e04aa01afe92264b9086cbb1