Skip to content

Commit 2d210c0

Browse files
committed
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 b6fc161 commit 2d210c0

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
@@ -232,12 +232,10 @@ impl Score for FixedPenaltyScorer {
232232
since = "0.0.105",
233233
note = "ProbabilisticScorer should be used instead of Scorer.",
234234
)]
235-
pub type Scorer = ScorerUsingTime::<ConfiguredTime>;
236-
237235
#[cfg(not(feature = "no-std"))]
238-
type ConfiguredTime = std::time::Instant;
236+
pub type Scorer = ScorerUsingTime::<std::time::Instant>;
239237
#[cfg(feature = "no-std")]
240-
type ConfiguredTime = time::Eternity;
238+
pub type Scorer = ScorerUsingTime::<time::Eternity>;
241239

242240
// Note that ideally we'd hide ScorerUsingTime from public view by sealing it as well, but rustdoc
243241
// 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> {
487485
/// behavior.
488486
///
489487
/// [1]: https://arxiv.org/abs/2107.05322
490-
pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, ConfiguredTime>;
488+
#[cfg(not(feature = "no-std"))]
489+
pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, std::time::Instant>;
490+
#[cfg(feature = "no-std")]
491+
pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, time::Eternity>;
491492

492493
/// Probabilistic [`Score`] implementation.
493494
///

0 commit comments

Comments
 (0)