From: Matt Corallo Date: Thu, 11 Feb 2021 15:23:41 +0000 (-0500) Subject: Drop a useless import and use `Self` in return values in Features X-Git-Tag: v0.0.13~27^2~8 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=61f5e79062d3ff3a1c12923530183910a30702d9;p=rust-lightning Drop a useless import and use `Self` in return values in Features `Result` is in the standard prelude, so no need to ever use it. Sadly, returning a Features in the `impl Futures {}` block will confuse our new alias-impl-printing logic, as we end up running through the normal impl-block-printing logic as if we had an explicit `impl ConcreteFeatures` block. --- diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 3ce3d4fa7..c97e18100 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -26,7 +26,6 @@ //! [`Context`]: sealed/trait.Context.html use std::{cmp, fmt}; -use std::result::Result; use std::marker::PhantomData; use ln::msgs::DecodeError; @@ -352,7 +351,7 @@ impl InitFeatures { impl Features { /// Create a blank Features with no features set - pub fn empty() -> Features { + pub fn empty() -> Self { Features { flags: Vec::new(), mark: PhantomData, @@ -362,7 +361,7 @@ impl Features { /// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. /// /// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS - pub fn known() -> Features { + pub fn known() -> Self { Self { flags: T::KNOWN_FEATURE_FLAGS.to_vec(), mark: PhantomData,