fix: fix clippy_lints

This commit is contained in:
Max Baumann 2022-03-17 19:52:07 +01:00
parent 747bb245e7
commit c22ff6cd6e
No known key found for this signature in database
GPG key ID: 20FA1609B03B1D6D

View file

@ -15,18 +15,25 @@ declare_clippy_lint! {
///
/// ### Example
/// ```rust
/// # let fallback = "fallback";
/// // Result
/// # type Error = &'static str;
/// # let result: Result<&str, Error> = Err("error");
/// let port = result.or::<Error>(Ok(fallback)).unwrap();
///
/// // Option
/// # let option: Option<&str> = None;
/// let value = option.or(Some(fallback)).unwrap();
/// ```
/// Use instead:
/// ```rust
/// # let fallback = "fallback";
/// // Result
/// # let result: Result<&str, &str> = Err("error");
/// let port = result.unwrap_or(fallback);
///
/// // Option
/// # let option: Option<&str> = None;
/// let value = option.unwrap_or(fallback);
/// ```
#[clippy::version = "1.61.0"]