mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3124 from jfinkels/head-enum-self
head: use Self instead of enum name Mode in method
This commit is contained in:
commit
4009bf9a89
1 changed files with 4 additions and 4 deletions
|
@ -124,17 +124,17 @@ impl Mode {
|
||||||
let (n, all_but_last) =
|
let (n, all_but_last) =
|
||||||
parse::parse_num(v).map_err(|err| format!("invalid number of bytes: {}", err))?;
|
parse::parse_num(v).map_err(|err| format!("invalid number of bytes: {}", err))?;
|
||||||
if all_but_last {
|
if all_but_last {
|
||||||
Ok(Mode::AllButLastBytes(n))
|
Ok(Self::AllButLastBytes(n))
|
||||||
} else {
|
} else {
|
||||||
Ok(Mode::FirstBytes(n))
|
Ok(Self::FirstBytes(n))
|
||||||
}
|
}
|
||||||
} else if let Some(v) = matches.value_of(options::LINES_NAME) {
|
} else if let Some(v) = matches.value_of(options::LINES_NAME) {
|
||||||
let (n, all_but_last) =
|
let (n, all_but_last) =
|
||||||
parse::parse_num(v).map_err(|err| format!("invalid number of lines: {}", err))?;
|
parse::parse_num(v).map_err(|err| format!("invalid number of lines: {}", err))?;
|
||||||
if all_but_last {
|
if all_but_last {
|
||||||
Ok(Mode::AllButLastLines(n))
|
Ok(Self::AllButLastLines(n))
|
||||||
} else {
|
} else {
|
||||||
Ok(Mode::FirstLines(n))
|
Ok(Self::FirstLines(n))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ok(Default::default())
|
Ok(Default::default())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue