From 72cdcda9eff98c7bd0cc07416c85e2d8c8de6983 Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 16:56:25 +0300 Subject: Bugfix in parse_block --- src/db.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/db.rs b/src/db.rs index 2187010..70204a2 100644 --- a/src/db.rs +++ b/src/db.rs @@ -122,8 +122,9 @@ fn read_block_name(config_name: &str) -> io::Result> { } fn parse_block(path: &str) -> u64 { + let start_pos = path.rfind("/").unwrap() + 1; let end_pos = path.find(".block").unwrap(); - let block_str = path[9..end_pos].to_string(); + let block_str = path[start_pos..end_pos].to_string(); let block_u64: u64 = block_str.parse().unwrap(); block_u64 } -- cgit v1.2.3-70-g09d2