Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi Z <chi@neon.tech>
  • Loading branch information
skyzh committed Jun 24, 2024
1 parent ad7974c commit 39bb15d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pageserver/ctl/src/draw_timeline_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ fn parse_filename(name: &str) -> (Range<Key>, Range<Lsn>) {
let keys: Vec<&str> = split[0].split('-').collect();
let mut lsns: Vec<&str> = split[1].split('-').collect();

// Handle generation number
// The current format of the layer file name: 000000067F0000000400000B150100000000-000000067F0000000400000D350100000000__00000000014B7AC8-v1-00000001

// Handle generation number `-00000001` part
if lsns.last().expect("should").len() == 8 {
lsns.pop();
}

// Handle version number
if lsns.last().expect("should").starts_with("v") {
// Handle version number `-v1` part
if lsns.last().expect("should").starts_with('v') {
lsns.pop();
}

Expand Down

0 comments on commit 39bb15d

Please sign in to comment.