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