diff --git a/rtcoin-server/src/db.rs b/rtcoin-server/src/db.rs index 563da98..de24ceb 100644 --- a/rtcoin-server/src/db.rs +++ b/rtcoin-server/src/db.rs @@ -3,7 +3,7 @@ // See LICENSE file for detailed license information. // -use std::{path::Path, sync::mpsc, thread}; +use std::{path::Path, sync::mpsc}; use log::info; @@ -202,14 +202,14 @@ impl DB { fn startup_check_tables(conn: &rusqlite::Connection) { conn.execute( "CREATE TABLE IF NOT EXISTS ledger ( - id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - type TEXT NOT NULL, - timestamp TEXT NOT NULL, - source TEXT NOT NULL, - destination TEXT NOT NULL, - amount REAL NOT NULL, - ledger_hash TEXT NOT NULL, - receipt_id INTEGER NOT NULL, + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + type TEXT NOT NULL, + timestamp TEXT NOT NULL, + source TEXT NOT NULL, + destination TEXT NOT NULL, + amount REAL NOT NULL, + ledger_hash TEXT NOT NULL, + receipt_id INTEGER NOT NULL, receipt_hash TEXT NOT NULL )", NO_PARAMS, diff --git a/rtcoin-server/src/user.rs b/rtcoin-server/src/user.rs index a8177e1..58a78f2 100644 --- a/rtcoin-server/src/user.rs +++ b/rtcoin-server/src/user.rs @@ -53,7 +53,7 @@ impl fmt::Display for User { } impl User { - pub fn new(name: &str) -> User { + pub fn new(name: &str) -> Self { let pass = String::new(); let name = name.to_string(); let now = Utc::now().to_rfc2822(); @@ -93,7 +93,7 @@ pub fn register(comm: db::Comm, db: &rusqlite::Connection) { None => return, }; let user = args[0].clone(); - let mut pass = args[1].clone(); + let pass = args[1].clone(); let pubkey = args[2].clone(); match check_pass(&pass) {