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
commit1688000fbc4669b30b986370d2773e0a9c55a918 (patch)
tree402cc8da9de38099fd32560a663ade4b0454c451 /src/schema.rs
parent9ad288e25973488a3cfc83533456d5d741e08e3b (diff)
downloadgradecoin-1688000fbc4669b30b986370d2773e0a9c55a918.tar.gz
gradecoin-1688000fbc4669b30b986370d2773e0a9c55a918.tar.bz2
gradecoin-1688000fbc4669b30b986370d2773e0a9c55a918.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 {