From 61f5e79062d3ff3a1c12923530183910a30702d9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 10:23:41 -0500 Subject: [PATCH] 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. --- lightning/src/ln/features.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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, -- 2.39.5