mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
rust: Simplify bpos FromStr
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
a3eb6ad8ef
commit
a8dbc331f0
@ -131,15 +131,15 @@ impl FromStr for c::bpos {
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
if s == "POS_MIN" {
|
||||
return Ok(c::bpos { inode: 0, offset: 0, snapshot: 0 });
|
||||
return Ok(POS_MIN);
|
||||
}
|
||||
|
||||
if s == "POS_MAX" {
|
||||
return Ok(c::bpos { inode: u64::MAX, offset: u64::MAX, snapshot: 0 });
|
||||
return Ok(POS_MAX);
|
||||
}
|
||||
|
||||
if s == "SPOS_MAX" {
|
||||
return Ok(c::bpos { inode: u64::MAX, offset: u64::MAX, snapshot: u32::MAX });
|
||||
return Ok(SPOS_MAX);
|
||||
}
|
||||
|
||||
let mut fields = s.split(':');
|
||||
|
Loading…
Reference in New Issue
Block a user