diff options
author | necrashter | 2022-04-23 16:56:25 +0300 |
---|---|---|
committer | Yigit Sever | 2022-04-23 18:10:12 +0300 |
commit | 72cdcda9eff98c7bd0cc07416c85e2d8c8de6983 (patch) | |
tree | 409f3ea9751ca4bde60c4484cb07bfa29fa5bb04 /src | |
parent | 92b37178167435027bb9e4db22b5c44977f341f9 (diff) | |
download | gradecoin-72cdcda9eff98c7bd0cc07416c85e2d8c8de6983.tar.gz gradecoin-72cdcda9eff98c7bd0cc07416c85e2d8c8de6983.tar.bz2 gradecoin-72cdcda9eff98c7bd0cc07416c85e2d8c8de6983.zip |
Bugfix in parse_block
Diffstat (limited to 'src')
-rw-r--r-- | src/db.rs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -122,8 +122,9 @@ fn read_block_name(config_name: &str) -> io::Result<Vec<PathBuf>> { | |||
122 | } | 122 | } |
123 | 123 | ||
124 | fn parse_block(path: &str) -> u64 { | 124 | fn parse_block(path: &str) -> u64 { |
125 | let start_pos = path.rfind("/").unwrap() + 1; | ||
125 | let end_pos = path.find(".block").unwrap(); | 126 | let end_pos = path.find(".block").unwrap(); |
126 | let block_str = path[9..end_pos].to_string(); | 127 | let block_str = path[start_pos..end_pos].to_string(); |
127 | let block_u64: u64 = block_str.parse().unwrap(); | 128 | let block_u64: u64 = block_str.parse().unwrap(); |
128 | block_u64 | 129 | block_u64 |
129 | } | 130 | } |