parent
2f22893287
commit
8b454cb2f5
@ -0,0 +1,6 @@
|
||||
use std::fmt::{Debug, Display};
|
||||
use std::fmt::Write as FmtWrite;
|
||||
|
||||
use crate::*;
|
||||
|
||||
impl_trait_object!(String, dyn Debug, dyn Display, dyn RawClone, dyn FmtWrite);
|
@ -0,0 +1,12 @@
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use crate::MultitraitObject;
|
||||
|
||||
impl Debug for MultitraitObject {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
if let Some(debug) = self.downcast_trait::<dyn Debug>() {
|
||||
debug.fmt(f)
|
||||
} else {
|
||||
write!(f, "<unavailable>")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,2 +1,5 @@
|
||||
mod try_clone;
|
||||
pub use try_clone::*;
|
||||
mod debug;
|
||||
|
||||
pub use try_clone::*;
|
||||
pub use debug::*;
|
Loading…
Reference in New Issue