Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix a Rust 1.45 Clippy warning #187

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

AzureMarker
Copy link
Contributor

Original warning:

warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
  --> autoendpoint/src/settings.rs:63:9
   |
63 | /         config.try_into::<Self>().or_else(|error| match error {
64 | |             // Configuration errors are not very sysop friendly, Try to make them
65 | |             // a bit more 3AM useful.
66 | |             ConfigError::Message(error_msg) => {
...  |
79 | |             }
80 | |         })
   | |__________^
   |
   = note: `#[warn(clippy::bind_instead_of_map)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
help: try this
   |
63 |         config.try_into::<Self>().map_err(|error| match error {
64 |             // Configuration errors are not very sysop friendly, Try to make them
65 |             // a bit more 3AM useful.
66 |             ConfigError::Message(error_msg) => {
67 |                 println!("Bad configuration: {:?}", &error_msg);
68 |                 println!("Please set in config file or use environment variable.");
 ...

@AzureMarker AzureMarker merged commit 2d4d08f into master Jul 17, 2020
@AzureMarker AzureMarker deleted the refactor/rust-1.45-clippy branch July 17, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants