Skip to content

Commit

Permalink
fix: use implicit keys for mise config set (#3744)
Browse files Browse the repository at this point in the history
* fix: use implicit keys for `mise config set`

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
jdx and autofix-ci[bot] authored Dec 20, 2024
1 parent 041d258 commit 3d61487
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cli/config/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ impl ConfigSet {
let mut container = config.as_item_mut();
let parts = self.key.split('.').collect::<Vec<&str>>();
for key in parts.iter().take(parts.len() - 1) {
container = container
.as_table_mut()
.unwrap()
.entry(key)
.or_insert(toml_edit::Item::Table(toml_edit::Table::new()));
container = container.as_table_mut().unwrap().entry(key).or_insert({
let mut t = toml_edit::Table::new();
t.set_implicit(true);
toml_edit::Item::Table(t)
});
}
let last_key = parts.last().unwrap();

Expand Down

0 comments on commit 3d61487

Please sign in to comment.