Less opinionated DynWriteLock

Allows easier reuse by future variants of UiOutputPair.
This commit is contained in:
Benjamin Saunders 2022-10-18 18:09:43 -07:00 committed by Martin von Zweigbergk
parent c046e1c845
commit d188240939

View file

@ -239,9 +239,9 @@ enum UiOutputPair {
}
/// Wrapper to implement `Write` for locked `Box<dyn Write>`.
struct DynWriteLock<'a, 'output>(MutexGuard<'a, Box<dyn Write + 'output>>);
struct DynWriteLock<'a, T>(MutexGuard<'a, T>);
impl Write for DynWriteLock<'_, '_> {
impl<T: Write> Write for DynWriteLock<'_, T> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}