From 71d2d8a2abe7c8f5504e67cb4698879c242ccc58 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 16 Feb 2023 14:28:01 +0000 Subject: [PATCH] fix: avoid `should-implement-trait` Clippy warning --- src/editor.rs | 2 +- src/terminal.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor.rs b/src/editor.rs index c68fa36..cb040c9 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -57,7 +57,7 @@ impl Default for Editor { }; Self { should_quit: false, - terminal: Terminal::default().expect("Failed to initialize terminal"), + terminal: Terminal::new().expect("Failed to initialize terminal"), document, cursor_position: Position::default(), offset: Position::default(), diff --git a/src/terminal.rs b/src/terminal.rs index de37319..e89fd08 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -18,7 +18,7 @@ pub struct Terminal { impl Terminal { /// # Errors /// Returns an error if terminal size cannot be retrieved or raw mode cannot be enabled. - pub fn default() -> Result { + pub fn new() -> Result { let size = termion::terminal_size()?; Ok(Self { size: Size {