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 /// ### Example
/// ```rust /// ```rust
/// # let fallback = "fallback";
/// // Result /// // Result
/// # type Error = &'static str;
/// # let result: Result<&str, Error> = Err("error");
/// let port = result.or::<Error>(Ok(fallback)).unwrap(); /// let port = result.or::<Error>(Ok(fallback)).unwrap();
/// ///
/// // Option /// // Option
/// # let option: Option<&str> = None;
/// let value = option.or(Some(fallback)).unwrap(); /// let value = option.or(Some(fallback)).unwrap();
/// ``` /// ```
/// Use instead: /// Use instead:
/// ```rust /// ```rust
/// # let fallback = "fallback";
/// // Result /// // Result
/// # let result: Result<&str, &str> = Err("error");
/// let port = result.unwrap_or(fallback); /// let port = result.unwrap_or(fallback);
/// ///
/// // Option /// // Option
/// # let option: Option<&str> = None;
/// let value = option.unwrap_or(fallback); /// let value = option.unwrap_or(fallback);
/// ``` /// ```
#[clippy::version = "1.61.0"] #[clippy::version = "1.61.0"]