Browse Source

Implement insert on borrow to prevent move

Otherwise the record can't be used anymore after calling its insert
method.
master
Andreas Linz 2 years ago
parent
commit
eacc6f0738
No known key found for this signature in database GPG Key ID: 8DEF5099A0822620
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/main.rs

+ 1
- 1
src/main.rs View File

@ -64,7 +64,7 @@ impl Record {
}
}
fn insert(self, conn: &rusqlite::Connection) -> Result<usize, TTError> {
fn insert(&self, conn: &rusqlite::Connection) -> Result<usize, TTError> {
conn.execute(
"INSERT INTO Timestamps VALUES (?1, ?2)",
&[&self.timestamp.naive_local(), &self.state],

Loading…
Cancel
Save