nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: kkawakam/rustyline
Pull request #234 (2019-06-02 06:08:05)

Fix warning: trait objects without an explicit `dyn` are deprecated


Patch:
diff --git a/src/tty/mod.rs b/src/tty/mod.rs
index 5af0382..94fddd2 100644
--- a/src/tty/mod.rs
+++ b/src/tty/mod.rs
@@ -80,7 +80,7 @@ pub trait Renderer {
     fn colors_enabled(&self) -> bool;
 
     /// Make sure prompt is at the leftmost edge of the screen
-    fn move_cursor_at_leftmost(&mut self, rdr: &mut RawReader) -> Result<()>;
+    fn move_cursor_at_leftmost(&mut self, rdr: &mut dyn RawReader) -> Result<()>;
 }
 
 impl<'a, R: Renderer + ?Sized> Renderer for &'a mut R {
@@ -147,7 +147,7 @@ impl<'a, R: Renderer + ?Sized> Renderer for &'a mut R {
         (**self).colors_enabled()
     }
 
-    fn move_cursor_at_leftmost(&mut self, rdr: &mut RawReader) -> Result<()> {
+    fn move_cursor_at_leftmost(&mut self, rdr: &mut dyn RawReader) -> Result<()> {
         (**self).move_cursor_at_leftmost(rdr)
     }
 }
diff --git a/src/tty/unix.rs b/src/tty/unix.rs
index f28f1a7..07eb951 100644
--- a/src/tty/unix.rs
+++ b/src/tty/unix.rs
@@ -644,7 +644,7 @@ impl Renderer for PosixRenderer {
         self.colors_enabled
     }
 
-    fn move_cursor_at_leftmost(&mut self, rdr: &mut RawReader) -> Result<()> {
+    fn move_cursor_at_leftmost(&mut self, rdr: &mut dyn RawReader) -> Result<()> {
         /* Report cursor location */
         self.write_and_flush(b"\x1b[6n")?;
         /* Read the response: ESC [ rows ; cols R */
@@ -664,7 +664,7 @@ impl Renderer for PosixRenderer {
     }
 }
 
-fn read_digits_until(rdr: &mut RawReader, sep: char) -> Result<u32> {
+fn read_digits_until(rdr: &mut dyn RawReader, sep: char) -> Result<u32> {
     let mut num: u32 = 0;
     loop {
         match rdr.next_char()? {
diff --git a/src/tty/windows.rs b/src/tty/windows.rs
index 2802bdd..e909a1f 100644
--- a/src/tty/windows.rs
+++ b/src/tty/windows.rs
@@ -438,7 +438,7 @@ impl Renderer for ConsoleRenderer {
         self.colors_enabled
     }
 
-    fn move_cursor_at_leftmost(&mut self, _: &mut RawReader) -> Result<()> {
+    fn move_cursor_at_leftmost(&mut self, _: &mut dyn RawReader) -> Result<()> {
         self.write_and_flush(b"")?; // we must do this otherwise the cursor position is not reported correctly
         let mut info = self.get_console_screen_buffer_info()?;
         if info.dwCursorPosition.X == 0 {


Test patch:
diff --git a/src/tty/test.rs b/src/tty/test.rs
index 19c72fe..ce0bfd5 100644
--- a/src/tty/test.rs
+++ b/src/tty/test.rs
@@ -127,7 +127,7 @@ impl Renderer for Sink {
         false
     }
 
-    fn move_cursor_at_leftmost(&mut self, _: &mut RawReader) -> Result<()> {
+    fn move_cursor_at_leftmost(&mut self, _: &mut dyn RawReader) -> Result<()> {
         Ok(())
     }
 }