Skip to content

Commit 440f6f2

Browse files
committed
Drop c_bindings implementation of scoring on Mutex/RefCell
This code was always effectively dead - we have a special `MultiThreadedLockableScore` type which wraps a `Mutex` for bindings users, so there's no need to implement any bindings-specific scoring logic for them.
1 parent 5cdfcba commit 440f6f2

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

lightning/src/routing/scoring.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub trait WriteableScore<'a>: LockableScore<'a> + Writeable {}
175175

176176
#[cfg(not(c_bindings))]
177177
impl<'a, T> WriteableScore<'a> for T where T: LockableScore<'a> + Writeable {}
178-
/// This is not exported to bindings users
178+
#[cfg(not(c_bindings))]
179179
impl<'a, T: 'a + Score> LockableScore<'a> for Mutex<T> {
180180
type Score = T;
181181
type Locked = MutexGuard<'a, T>;
@@ -185,6 +185,7 @@ impl<'a, T: 'a + Score> LockableScore<'a> for Mutex<T> {
185185
}
186186
}
187187

188+
#[cfg(not(c_bindings))]
188189
impl<'a, T: 'a + Score> LockableScore<'a> for RefCell<T> {
189190
type Score = T;
190191
type Locked = RefMut<'a, T>;
@@ -255,21 +256,7 @@ impl<'a, T: 'a + Score> Deref for MultiThreadedScoreLock<'a, T> {
255256
}
256257
}
257258

258-
#[cfg(c_bindings)]
259-
/// This is not exported to bindings users
260-
impl<'a, T: Writeable> Writeable for RefMut<'a, T> {
261-
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
262-
T::write(&**self, writer)
263-
}
264-
}
265259

266-
#[cfg(c_bindings)]
267-
/// This is not exported to bindings users
268-
impl<'a, S: Writeable> Writeable for MutexGuard<'a, S> {
269-
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
270-
S::write(&**self, writer)
271-
}
272-
}
273260

274261
/// Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
275262
#[derive(Clone, Copy, Debug, PartialEq)]

0 commit comments

Comments
 (0)