mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-25 03:50:29 +01:00
Fix bug wherein the Codec was clearing the buf after decoding a message. Don't do thatgit stash pop!
This commit is contained in:
15
src/util.rs
15
src/util.rs
@@ -136,3 +136,18 @@ pub fn spawn_core() -> reactor::Remote {
|
||||
});
|
||||
rx.recv().unwrap()
|
||||
}
|
||||
|
||||
/// A struct that will format as the contained type if the type impls Debug.
|
||||
pub struct Debugger<'a, T: 'a>(pub &'a T);
|
||||
|
||||
impl<'a, T: fmt::Debug> fmt::Debug for Debugger<'a, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
write!(f, "{:?}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> fmt::Debug for Debugger<'a, T> {
|
||||
default fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
write!(f, "{{not debuggable}}")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user