Rust-clippy: False positive or_fun_call with Result

Created on 14 Oct 2016  路  3Comments  路  Source: rust-lang/rust-clippy

fn main() {
  let x: Result<String, ()> = Ok("asd".to_string());
  x.unwrap_or(String::new());
}

The message suggests x.unwrap_or_default() but there is no such method for Result. It exists only for Option.

L-bug

All 3 comments

I'm closing this as it seems to be working as designed. Please reopen if you disagree.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthiaskrgr picture matthiaskrgr  路  3Comments

Luro02 picture Luro02  路  3Comments

wareya picture wareya  路  3Comments

spease picture spease  路  3Comments

nbaksalyar picture nbaksalyar  路  3Comments