From 48bab5eb128fd06f1733d0a7ee20568791180db4 Mon Sep 17 00:00:00 2001 From: Jordan MacDonald Date: Sun, 7 Apr 2024 00:23:22 -0400 Subject: [PATCH] Use Default trait for PathMode constructor --- src/models/application/modes/path.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/models/application/modes/path.rs b/src/models/application/modes/path.rs index 1277c825..758fd146 100644 --- a/src/models/application/modes/path.rs +++ b/src/models/application/modes/path.rs @@ -1,5 +1,6 @@ use std::fmt; +#[derive(Default)] pub struct PathMode { pub input: String, pub save_on_accept: bool, @@ -7,10 +8,7 @@ pub struct PathMode { impl PathMode { pub fn new() -> PathMode { - PathMode { - input: String::new(), - save_on_accept: false, - } + PathMode::default() } pub fn push_char(&mut self, c: char) {