Skip to content

Commit 186df43

Browse files
TheBlueMattjkczyz
authored andcommitted
Simplify type aliasing somewhat around times
.. as the current C bindings generator isn't capable of handling type aliases in generics in type alias definition currently.
1 parent 0817bbb commit 186df43

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lightning/src/routing/scoring.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,10 @@ impl ReadableArgs<u64> for FixedPenaltyScorer {
247247
since = "0.0.105",
248248
note = "ProbabilisticScorer should be used instead of Scorer.",
249249
)]
250-
pub type Scorer = ScorerUsingTime::<ConfiguredTime>;
251-
252250
#[cfg(not(feature = "no-std"))]
253-
type ConfiguredTime = std::time::Instant;
251+
pub type Scorer = ScorerUsingTime::<std::time::Instant>;
254252
#[cfg(feature = "no-std")]
255-
type ConfiguredTime = time::Eternity;
253+
pub type Scorer = ScorerUsingTime::<time::Eternity>;
256254

257255
// Note that ideally we'd hide ScorerUsingTime from public view by sealing it as well, but rustdoc
258256
// doesn't handle this well - instead exposing a `Scorer` which has no trait implementation(s) or
@@ -503,7 +501,10 @@ impl<T: Time> Readable for ChannelFailure<T> {
503501
/// behavior.
504502
///
505503
/// [1]: https://arxiv.org/abs/2107.05322
506-
pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, ConfiguredTime>;
504+
#[cfg(not(feature = "no-std"))]
505+
pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, std::time::Instant>;
506+
#[cfg(feature = "no-std")]
507+
pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, time::Eternity>;
507508

508509
/// Probabilistic [`Score`] implementation.
509510
///

0 commit comments

Comments
 (0)