Skip to content

Commit

Permalink
Merge pull request #282 from mh-northlander/fix/dictionary-repr
Browse files Browse the repository at this point in the history
fix dictionary.__repr__ for no user-dict case
  • Loading branch information
mh-northlander authored Dec 4, 2024
2 parents fc3ffa4 + 17f2e40 commit 09af4eb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,20 +450,17 @@ fn config_repr(cfg: &Config) -> Result<String, std::fmt::Error> {
match cfg.resolved_user_dicts() {
Ok(dicts) => {
for (i, dic) in dicts.iter().enumerate() {
write!(result, "{}", dic.display())?;
if i + 1 == dicts.len() {
write!(result, "]")?;
} else {
if i != 0 {
write!(result, ", ")?;
}
write!(result, "{}", dic.display())?;
}
}
Err(e) => {
write!(result, "<err:{:?}>", e)?;
}
}

write!(result, ")>")?;
write!(result, "])>")?;
Ok(result)
}

Expand Down

0 comments on commit 09af4eb

Please sign in to comment.