diff options
author | Joris | 2022-12-18 15:03:51 +0100 |
---|---|---|
committer | Joris | 2022-12-18 15:03:51 +0100 |
commit | a6fd0110b65ec352603d69b9c4ccf3532689cd32 (patch) | |
tree | f6f8694a40ce620705525f1aca67edeba3074c0b /src/db | |
parent | 241089e3a1427c2968b296cc6c4112e45b78c278 (diff) |
Upgrade dependencies
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/events.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/db/events.rs b/src/db/events.rs index 86206bb..1721967 100644 --- a/src/db/events.rs +++ b/src/db/events.rs @@ -11,11 +11,11 @@ pub fn insert(conn: &Connection, event: &Event) -> Result<()> { None => None, }; - let category = event.category.map(|id| id.to_hyphenated().to_string()); + let category = event.category.map(|id| id.hyphenated().to_string()); conn.execute( "INSERT INTO events (id, date, start, end, name, repetition, category, created, updated) VALUES (?, ?, ?, ?, ?, ?, ?, datetime(), datetime())", - params![event.id.to_hyphenated().to_string(), event.date, event.start, event.end, event.name, repetition, category] + params![event.id.hyphenated().to_string(), event.date, event.start, event.end, event.name, repetition, category] )?; Ok(()) @@ -27,11 +27,11 @@ pub fn update(conn: &Connection, event: &Event) -> Result<()> { None => None, }; - let category = event.category.map(|id| id.to_hyphenated().to_string()); + let category = event.category.map(|id| id.hyphenated().to_string()); conn.execute( "UPDATE events SET date = ?, start = ?, end = ?, name = ?, repetition = ?, category = ?, updated = datetime() WHERE id = ?", - params![event.date, event.start, event.end, event.name, repetition, category, event.id.to_hyphenated().to_string()] + params![event.date, event.start, event.end, event.name, repetition, category, event.id.hyphenated().to_string()] )?; Ok(()) @@ -40,7 +40,7 @@ pub fn update(conn: &Connection, event: &Event) -> Result<()> { pub fn delete(conn: &Connection, id: &Uuid) -> Result<()> { conn.execute( "DELETE FROM events WHERE id = ?", - params![id.to_hyphenated().to_string()], + params![id.hyphenated().to_string()], )?; Ok(()) |