complete_datastore_name: write more compact code
This commit is contained in:
parent
30d2e99c77
commit
e3d40bb8cd
|
@ -79,18 +79,8 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
|
|||
|
||||
// shell completion helper
|
||||
pub fn complete_datastore_name() -> Vec<String> {
|
||||
|
||||
let data = match config() {
|
||||
Ok(data) => data,
|
||||
match config() {
|
||||
Ok(data) => data.sections.iter().map(|(id,_)| id.to_string()).collect(),
|
||||
Err(_) => return vec![],
|
||||
};
|
||||
|
||||
//let test = data.sections
|
||||
let mut res = vec![];
|
||||
|
||||
for (id, _) in data.sections {
|
||||
res.push(id);
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue