aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/events.rs10
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(())