Simplify type aliasing somewhat around times 2022-02-bindings-105
authorMatt Corallo <git@bluematt.me>
Tue, 1 Mar 2022 03:47:28 +0000 (03:47 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 1 Mar 2022 03:51:03 +0000 (03:51 +0000)
.. as the current C bindings generator isn't capable of handling
type aliases in generics in type alias definition currently.

lightning/src/routing/scoring.rs

index dfda3d2f867d189c7f36de9b45072c01bed98816..6b399dec663860621c7039dfd64accf56cfff8c1 100644 (file)
@@ -232,12 +232,10 @@ impl Score for FixedPenaltyScorer {
        since = "0.0.105",
        note = "ProbabilisticScorer should be used instead of Scorer.",
 )]
-pub type Scorer = ScorerUsingTime::<ConfiguredTime>;
-
 #[cfg(not(feature = "no-std"))]
-type ConfiguredTime = std::time::Instant;
+pub type Scorer = ScorerUsingTime::<std::time::Instant>;
 #[cfg(feature = "no-std")]
-type ConfiguredTime = time::Eternity;
+pub type Scorer = ScorerUsingTime::<time::Eternity>;
 
 // Note that ideally we'd hide ScorerUsingTime from public view by sealing it as well, but rustdoc
 // doesn't handle this well - instead exposing a `Scorer` which has no trait implementation(s) or
@@ -487,7 +485,10 @@ impl<T: Time> Readable for ChannelFailure<T> {
 /// behavior.
 ///
 /// [1]: https://arxiv.org/abs/2107.05322
-pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, ConfiguredTime>;
+#[cfg(not(feature = "no-std"))]
+pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, std::time::Instant>;
+#[cfg(feature = "no-std")]
+pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, time::Eternity>;
 
 /// Probabilistic [`Score`] implementation.
 ///