diff options
Diffstat (limited to 'src/db.rs')
-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 | } |