component: impl Debug for Expect
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
35e323f448
commit
ab9f824dec
1 changed files with 12 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
use crate::error::Error;
|
||||
|
||||
use std::fmt;
|
||||
use std::marker::Send;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::pin::Pin;
|
||||
|
@ -80,6 +81,17 @@ enum Expect {
|
|||
Callback(Box<dyn FnOnce(Element) + Send + 'static>),
|
||||
}
|
||||
|
||||
impl fmt::Debug for Expect {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Expect::")?;
|
||||
match self {
|
||||
Expect::Element(el) => write!(f, "Element({:?})", String::from(el)),
|
||||
Expect::Callback(_) => write!(f, "Callback(<cb>)"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TestComponent {
|
||||
in_buffer: Vec<Element>,
|
||||
out_buffer: Vec<Element>,
|
||||
|
|
Loading…
Reference in a new issue