From: Matt Corallo Date: Fri, 23 Sep 2022 08:17:01 +0000 (+0000) Subject: Rename `MultiThreadedLockableScoreLock` to `MultiThreadedScoreLock` X-Git-Tag: v0.0.112~28^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2022-09-better-lock-name;p=rust-lightning Rename `MultiThreadedLockableScoreLock` to `MultiThreadedScoreLock` as the first is quite a mouthful, and the second isn't materially less specific. --- diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index 66900f2ba..f27464e4d 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -189,9 +189,9 @@ pub struct MultiThreadedLockableScore { } #[cfg(c_bindings)] /// A locked `MultiThreadedLockableScore`. -pub struct MultiThreadedLockableScoreLock<'a, S: Score>(MutexGuard<'a, S>); +pub struct MultiThreadedScoreLock<'a, S: Score>(MutexGuard<'a, S>); #[cfg(c_bindings)] -impl<'a, T: Score + 'a> Score for MultiThreadedLockableScoreLock<'a, T> { +impl<'a, T: Score + 'a> Score for MultiThreadedScoreLock<'a, T> { fn channel_penalty_msat(&self, scid: u64, source: &NodeId, target: &NodeId, usage: ChannelUsage) -> u64 { self.0.channel_penalty_msat(scid, source, target, usage) } @@ -209,7 +209,7 @@ impl<'a, T: Score + 'a> Score for MultiThreadedLockableScoreLock<'a, T> { } } #[cfg(c_bindings)] -impl<'a, T: Score + 'a> Writeable for MultiThreadedLockableScoreLock<'a, T> { +impl<'a, T: Score + 'a> Writeable for MultiThreadedScoreLock<'a, T> { fn write(&self, writer: &mut W) -> Result<(), io::Error> { self.0.write(writer) } @@ -217,10 +217,10 @@ impl<'a, T: Score + 'a> Writeable for MultiThreadedLockableScoreLock<'a, T> { #[cfg(c_bindings)] impl<'a, T: Score + 'a> LockableScore<'a> for MultiThreadedLockableScore { - type Locked = MultiThreadedLockableScoreLock<'a, T>; + type Locked = MultiThreadedScoreLock<'a, T>; - fn lock(&'a self) -> MultiThreadedLockableScoreLock<'a, T> { - MultiThreadedLockableScoreLock(Mutex::lock(&self.score).unwrap()) + fn lock(&'a self) -> MultiThreadedScoreLock<'a, T> { + MultiThreadedScoreLock(Mutex::lock(&self.score).unwrap()) } }