Using inspect
instead of map
This commit is contained in:
parent
f09b2dd0ab
commit
63b55b14b3
|
@ -467,13 +467,12 @@ impl Signature {
|
||||||
/// Checks if short or long are already present
|
/// Checks if short or long are already present
|
||||||
/// Panics if one of them is found
|
/// Panics if one of them is found
|
||||||
fn check_names(&self, name: impl Into<String>, short: Option<char>) -> (String, Option<char>) {
|
fn check_names(&self, name: impl Into<String>, short: Option<char>) -> (String, Option<char>) {
|
||||||
let s = short.map(|c| {
|
let s = short.inspect(|c| {
|
||||||
assert!(
|
assert!(
|
||||||
!self.get_shorts().contains(&c),
|
!self.get_shorts().contains(c),
|
||||||
"There may be duplicate short flags for '-{}'",
|
"There may be duplicate short flags for '-{}'",
|
||||||
c
|
c
|
||||||
);
|
);
|
||||||
c
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let name = {
|
let name = {
|
||||||
|
|
|
@ -61,9 +61,8 @@ impl ForegroundChild {
|
||||||
pipeline_state: Some(pipeline_state.clone()),
|
pipeline_state: Some(pipeline_state.clone()),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map_err(|e| {
|
.inspect_err(|_e| {
|
||||||
foreground_pgroup::reset();
|
foreground_pgroup::reset();
|
||||||
e
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
command.spawn().map(|child| Self {
|
command.spawn().map(|child| Self {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user