chiark / gitweb /
wdt: wip new pos handling trait
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Jan 2021 16:08:38 +0000 (16:08 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Jan 2021 17:58:12 +0000 (17:58 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
wdriver.rs

index 742177ceb867571f5f817f8fd964d5f2b8505f5b..c335c0cc02f302fb7b7b93413d04330ad1365c23 100644 (file)
@@ -1103,6 +1103,17 @@ impl Drop for FinalInfoCollection {
   }
 }
 
+trait IntoInWindow<T> {
+  fn w_into<'g>(self, w: &'g WindowGuard) -> Result<T, AE>;
+}
+
+impl IntoInWindow<WebPos> for Pos {
+  #[throws(AE)]
+  fn w_into<'g>(self, w: &'g WindowGuard) -> WebPos {
+    w.posg2posw(self)?
+  }
+}
+
 impl Drop for Setup {
   fn drop(&mut self) {
     (||{