drop
drop copied to clipboard
[FYI] warnings emitted when building AUR package
Hi, thanks for offering this very nice application in the AUR. During my latest makepkg routine I noticed the below warnings and I thought you might be interested in the output.
$ pacman -Q rust
rustup 1.24.3-1
[...]
Compiling pango v0.2.0
warning: use of deprecated function `std::env::home_dir`: This function's behavior is unexpected and probably not what you want. Consider using a crate from crates.io instead.
--> src/conf.rs:23:18
|
23 | let home_dir = std::env::home_dir().unwrap();
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
--> src/conf.rs:14:1
|
14 | / lazy_static! {
15 | | static ref AUDIO_SOURCES: HashSet<String> = ["desktop".to_string(), "mic".to_string()].iter().cloned().collect();
16 | | static ref FILENAME_STRATEGIES: HashSet<String> = ["prepend".to_string(),
17 | | "append".to_string(),
18 | | "exact".to_string(),
19 | | "replace".to_string()].iter().cloned().collect();
20 | | }
| |_^
|
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
--> src/conf.rs:14:1
|
14 | / lazy_static! {
15 | | static ref AUDIO_SOURCES: HashSet<String> = ["desktop".to_string(), "mic".to_string()].iter().cloned().collect();
16 | | static ref FILENAME_STRATEGIES: HashSet<String> = ["prepend".to_string(),
17 | | "append".to_string(),
18 | | "exact".to_string(),
19 | | "replace".to_string()].iter().cloned().collect();
20 | | }
| |_^
|
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
--> src/conf.rs:14:1
|
14 | / lazy_static! {
15 | | static ref AUDIO_SOURCES: HashSet<String> = ["desktop".to_string(), "mic".to_string()].iter().cloned().collect();
16 | | static ref FILENAME_STRATEGIES: HashSet<String> = ["prepend".to_string(),
17 | | "append".to_string(),
18 | | "exact".to_string(),
19 | | "replace".to_string()].iter().cloned().collect();
20 | | }
| |_^
|
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
--> src/conf.rs:14:1
|
14 | / lazy_static! {
15 | | static ref AUDIO_SOURCES: HashSet<String> = ["desktop".to_string(), "mic".to_string()].iter().cloned().collect();
16 | | static ref FILENAME_STRATEGIES: HashSet<String> = ["prepend".to_string(),
17 | | "append".to_string(),
18 | | "exact".to_string(),
19 | | "replace".to_string()].iter().cloned().collect();
20 | | }
| |_^
|
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: panic message is not a string literal
--> src/conf.rs:64:12
|
64 | panic!(format!("Unrecognized filename strategy: {}", strat))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(non_fmt_panic)]` on by default
= note: this is no longer accepted in Rust 2021
= note: the panic!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
64 | panic!("Unrecognized filename strategy: {}", strat)
| -- --
warning: unused `Result` that must be used
--> src/screenshot.rs:196:3
|
196 | fs::remove_file(pamfile);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
warning: unused `Result` that must be used
--> src/screenshot.rs:197:3
|
197 | fs::remove_dir_all(cachedir);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
warning: 8 warnings emitted
Regards
Thanks for the heads up! I'll be making a code cleanup pass soon