mirror of
https://github.com/nushell/nushell.git
synced 2025-06-19 17:38:14 +02:00
Use Default for making Suggestions in attribute_completions (#15764)
# Description In preparation for https://github.com/nushell/reedline/pull/798, which adds a new field to `Suggestion`, this PR makes sure that `Suggestion`s are created using `..Default::default()` inside `attribute_completions.rs`. # User-Facing Changes None # Tests + Formatting None # After Submitting
This commit is contained in:
parent
bb37306d07
commit
7b88bda9a1
@ -33,13 +33,12 @@ impl Completer for AttributeCompletion {
|
|||||||
suggestion: Suggestion {
|
suggestion: Suggestion {
|
||||||
value: String::from_utf8_lossy(name).into_owned(),
|
value: String::from_utf8_lossy(name).into_owned(),
|
||||||
description: desc,
|
description: desc,
|
||||||
style: None,
|
|
||||||
extra: None,
|
|
||||||
span: reedline::Span {
|
span: reedline::Span {
|
||||||
start: span.start - offset,
|
start: span.start - offset,
|
||||||
end: span.end - offset,
|
end: span.end - offset,
|
||||||
},
|
},
|
||||||
append_whitespace: false,
|
append_whitespace: false,
|
||||||
|
..Default::default()
|
||||||
},
|
},
|
||||||
kind: Some(SuggestionKind::Command(ty, Some(decl_id))),
|
kind: Some(SuggestionKind::Command(ty, Some(decl_id))),
|
||||||
});
|
});
|
||||||
@ -70,13 +69,12 @@ impl Completer for AttributableCompletion {
|
|||||||
suggestion: Suggestion {
|
suggestion: Suggestion {
|
||||||
value: cmd.name().into(),
|
value: cmd.name().into(),
|
||||||
description: Some(cmd.description().into()),
|
description: Some(cmd.description().into()),
|
||||||
style: None,
|
|
||||||
extra: None,
|
|
||||||
span: reedline::Span {
|
span: reedline::Span {
|
||||||
start: span.start - offset,
|
start: span.start - offset,
|
||||||
end: span.end - offset,
|
end: span.end - offset,
|
||||||
},
|
},
|
||||||
append_whitespace: false,
|
append_whitespace: false,
|
||||||
|
..Default::default()
|
||||||
},
|
},
|
||||||
kind: Some(SuggestionKind::Command(cmd.command_type(), None)),
|
kind: Some(SuggestionKind::Command(cmd.command_type(), None)),
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user