Skip to content

Commit

Permalink
use Self
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnemecek committed Aug 12, 2024
1 parent b28a874 commit 8bddee0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ pub struct HistoryHinter {}

impl HistoryHinter {
/// Create a new `HistoryHinter`
pub fn new() -> HistoryHinter {
HistoryHinter::default()
pub fn new() -> Self {
Self::default()
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/line_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@ mod test {
}

impl Listener {
fn new() -> Listener {
Listener { deleted_str: None }
fn new() -> Self {
Self { deleted_str: None }
}

fn assert_deleted_str_eq(&self, expected: &str) {
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl SQLiteHistory {

fn new(config: Config, path: Option<PathBuf>) -> Result<Self> {
let conn = conn(path.as_ref())?;
let mut sh = SQLiteHistory {
let mut sh = Self {
max_len: config.max_history_size(),
ignore_space: config.history_ignore_space(),
// not strictly consecutive...
Expand Down
4 changes: 2 additions & 2 deletions src/tty/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ impl Term for DummyTerminal {
bell_style: BellStyle,
_enable_bracketed_paste: bool,
_enable_signals: bool,
) -> Result<DummyTerminal> {
Ok(DummyTerminal {
) -> Result<Self> {
Ok(Self {
keys: vec![],
cursor: 0,
color_mode,
Expand Down
2 changes: 1 addition & 1 deletion src/tty/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl ConsoleRenderer {
fn new(conout: HANDLE, colors_enabled: bool, bell_style: BellStyle) -> ConsoleRenderer {
// Multi line editing is enabled by ENABLE_WRAP_AT_EOL_OUTPUT mode
let (cols, _) = get_win_size(conout);
ConsoleRenderer {
Self {
conout,
cols,
buffer: String::with_capacity(1024),
Expand Down

0 comments on commit 8bddee0

Please sign in to comment.