Rust-clippy: Truncated message

Created on 18 Jan 2018  路  4Comments  路  Source: rust-lang/rust-clippy

I recently got the following message:

warning: use of `unwrap_or` followed by a function call
  --> jni-gen/src/generators/module.rs:17:24
   |
17 |       let modules_tree = modules
   |  ________________________^
18 | |         .visit(|modules| {
19 | |             let modules: HashMap<String, Option<String>> = modules;
20 | |             let mut res: Vec<String> = vec![];
...  |
36 | |         })
37 | |         .unwrap_or("// No modules".to_string());
   | |_______________________________________________^
   |
   = note: #[warn(or_fun_call)] on by default
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.180/index.html#or_fun_call
help: try this
   |
17 |     let modules_tree = modules
18 |         .visit(|modules| {
19 |             let modules: HashMap<String, Option<String>> = modules;
20 |             let mut res: Vec<String> = vec![];
21 |             for (name, opt_rec_result) in modules {
22 |                 match opt_rec_result {
 ...

The issue is that the suggested change regarding unwrap_or is not shown.

L-bug

All 4 comments

I'm going to be looking at or_fun_call this coming weekend to implement https://github.com/rust-lang-nursery/rust-clippy/issues/2338. I'll fix this then if the issue is still open.

I fear this is something that needs to be fixed in rustc.

I believed this is fixed.

Yeah, the or_fun_call lint now has a much smaller suggestion span so this should indeed be fixed

Was this page helpful?
0 / 5 - 0 ratings