aboutsummaryrefslogtreecommitdiffstats
path: root/src/schema.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-19 03:57:46 +0300
committerYigit Sever2021-04-19 03:57:46 +0300
commitbf82e58be3398b93a9a6950fc1a473eee29cbd4b (patch)
treee590300d3d5efaf0311b8530732e78bd31b7480f /src/schema.rs
parent87c312b9629b3ad8da441d8ebe71d2c3a431f20b (diff)
downloadgradecoin-bf82e58be3398b93a9a6950fc1a473eee29cbd4b.tar.gz
gradecoin-bf82e58be3398b93a9a6950fc1a473eee29cbd4b.tar.bz2
gradecoin-bf82e58be3398b93a9a6950fc1a473eee29cbd4b.zip
Add default for Db
Diffstat (limited to 'src/schema.rs')
-rw-r--r--src/schema.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/schema.rs b/src/schema.rs
index eae60af..81bfc1b 100644
--- a/src/schema.rs
+++ b/src/schema.rs
@@ -34,7 +34,7 @@ fn block_parser(path: String) -> u64 {
34fn last_block_content() -> Option<String> { 34fn last_block_content() -> Option<String> {
35 let blocks = read_block_name().unwrap(); 35 let blocks = read_block_name().unwrap();
36 36
37 if blocks.len() == 0 { 37 if blocks.is_empty() {
38 return None; 38 return None;
39 } 39 }
40 40
@@ -173,6 +173,12 @@ impl Db {
173 } 173 }
174} 174}
175 175
176impl Default for Db {
177 fn default() -> Self {
178 Self::new()
179 }
180}
181
176/// A transaction between `source` and `target` that moves `amount` 182/// A transaction between `source` and `target` that moves `amount`
177#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] 183#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
178pub struct Transaction { 184pub struct Transaction {