From: Ian Jackson Date: Mon, 5 Apr 2021 16:15:44 +0000 (+0100) Subject: wdriver: LogIgnoreBefore: More impls X-Git-Tag: otter-0.5.0~169 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1378d7dab21b0deb8533fc1ee66ea6189d60cfe0;p=otter.git wdriver: LogIgnoreBefore: More impls Signed-off-by: Ian Jackson --- diff --git a/wdriver/wdriver.rs b/wdriver/wdriver.rs index 745d7a05..7c649475 100644 --- a/wdriver/wdriver.rs +++ b/wdriver/wdriver.rs @@ -266,7 +266,15 @@ pub trait LogIgnoreBefore { type LogIgnoreBeforeFn<'r> = &'r mut dyn FnMut(&str) -> bool; impl<'r> LogIgnoreBefore for LogIgnoreBeforeFn<'r> { - fn matches<'s>(&mut self, s: &'s str) -> bool { self(s) } + fn matches(&mut self, s: &str) -> bool { self(s) } +} +impl LogIgnoreBefore for HtmlLit { + fn matches(&mut self, s: &str) -> bool { s.contains(self.as_html_str()) } +} +impl LogIgnoreBefore for Generation { + fn matches(&mut self, s: &str) -> bool { + s == synch_logentry(*self).as_html_str() + } } impl<'g> WindowGuard<'g> {