toml-rs/toml

Document `Item::None` return values

T0mstone opened this issue · 1 comments

Context: I have a custom wrapper on top of toml_edit that allows carrying around a mix of mutable references and owned data.

I was severely confused by Item::None and its complete lack of explanation (since none is not something in the TOML spec).

After reading #299, I now have somewhat of an idea what Item::None is used for, but I find it really annoying to deal with.
My proposal: I would like it if everything that returned an Item documented exactly if and when it returns Item::None.

In particular, I'm looking at OccupiedEntry::{get,into}_mut. I assume that they can't return Item::None (as that wouldn't make sense), but without proper documentation, I can't be sure.

Agreed. I'd have to go through myself to refresh on it. I tend to just ignore it for my own purposes.