mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'Refactor-prepare_tab_completion-function' into 'master'
Convert 'prepare_tab_completion' to ternary operation in 'chat' file See merge request veloren/veloren!2579
This commit is contained in:
commit
4b1a3891df
@ -106,11 +106,11 @@ impl<'a> Chat<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn prepare_tab_completion(mut self, input: String) -> Self {
|
pub fn prepare_tab_completion(mut self, input: String) -> Self {
|
||||||
if let Some(index) = input.find('\t') {
|
self.force_completions = if let Some(index) = input.find('\t') {
|
||||||
self.force_completions = Some(cmd::complete(&input[..index], &self.client));
|
Some(cmd::complete(&input[..index], &self.client))
|
||||||
} else {
|
} else {
|
||||||
self.force_completions = None;
|
None
|
||||||
}
|
};
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user