chiark / gitweb /
wdriver: LogIgnoreBefore: More impls
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 5 Apr 2021 16:15:44 +0000 (17:15 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 5 Apr 2021 16:31:23 +0000 (17:31 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
wdriver/wdriver.rs

index 745d7a059026d09982fd58fdbe12295046da6f7e..7c649475adf26eeb0d86ca699b040e0195738ed9 100644 (file)
@@ -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> {