Skip to content

Commit

Permalink
Rename MultiThreadedLockableScoreLock to MultiThreadedScoreLock
Browse files Browse the repository at this point in the history
as the first is quite a mouthful, and the second isn't materially
less specific.
  • Loading branch information
TheBlueMatt committed Sep 23, 2022
1 parent 5211bfd commit ba021f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lightning/src/routing/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ pub struct MultiThreadedLockableScore<S: Score> {
}
#[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)
}
Expand All @@ -209,18 +209,18 @@ 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<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
self.0.write(writer)
}
}

#[cfg(c_bindings)]
impl<'a, T: Score + 'a> LockableScore<'a> for MultiThreadedLockableScore<T> {
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())
}
}

Expand Down

0 comments on commit ba021f8

Please sign in to comment.