diff options
author | Joris | 2025-02-07 10:49:24 +0100 |
---|---|---|
committer | Joris | 2025-02-07 10:49:24 +0100 |
commit | a217f4c75def40889710cfcf776ff827745fb6ff (patch) | |
tree | 837d4175b7786284a89d1cc41df518e23c8bc0b0 /src/gui/form | |
parent | 99fe1002c5961dcf5063b7ed51a9dfc426f96ace (diff) |
Use &str instead of String in funcion params when possible
Diffstat (limited to 'src/gui/form')
-rw-r--r-- | src/gui/form/mod.rs | 8 | ||||
-rw-r--r-- | src/gui/form/repetition.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/form/mod.rs b/src/gui/form/mod.rs index 197bc14..a14fb82 100644 --- a/src/gui/form/mod.rs +++ b/src/gui/form/mod.rs @@ -256,10 +256,10 @@ pub async fn show(app: &App, target: Target) { match event::validate( id, - date.buffer().text().to_string(), - name.buffer().text().to_string(), - start.buffer().text().to_string(), - end.buffer().text().to_string(), + &date.buffer().text(), + &name.buffer().text(), + &start.buffer().text(), + &end.buffer().text(), repetition, category, ) { diff --git a/src/gui/form/repetition.rs b/src/gui/form/repetition.rs index 4ed9803..6e7a13f 100644 --- a/src/gui/form/repetition.rs +++ b/src/gui/form/repetition.rs @@ -195,7 +195,7 @@ pub fn validate( // Check until let until = (if frequency.is_some() { - match validation::non_empty(model.until.buffer().text().to_string()) { + match validation::non_empty(&model.until.buffer().text()) { Some(until) => match NaiveDate::parse_from_str(&until, event::DATE_FORMAT) { Ok(until) => Ok(Some(until)), Err(_) => Err(format!("Can’t parse date from {}", until)), |