Drop a useless import and use `Self` in return values in Features
authorMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 15:23:41 +0000 (10:23 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 18 Feb 2021 17:28:25 +0000 (12:28 -0500)
`Result` is in the standard prelude, so no need to ever use it.

Sadly, returning a Features<T> 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

index 3ce3d4fa7e604b9e0fb979dd8f4da0911adbdda2..c97e18100fc769fd906a201f4868f3e662d21852 100644 (file)
@@ -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<T: sealed::Context> Features<T> {
        /// Create a blank Features with no features set
-       pub fn empty() -> Features<T> {
+       pub fn empty() -> Self {
                Features {
                        flags: Vec::new(),
                        mark: PhantomData,
@@ -362,7 +361,7 @@ impl<T: sealed::Context> Features<T> {
        /// 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<T> {
+       pub fn known() -> Self {
                Self {
                        flags: T::KNOWN_FEATURE_FLAGS.to_vec(),
                        mark: PhantomData,