Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Item::None return values #683

Open
T0mstone opened this issue Feb 9, 2024 · 1 comment
Open

Document Item::None return values #683

T0mstone opened this issue Feb 9, 2024 · 1 comment
Labels
A-edit Area: TOML editing API C-enhancement Category: Raise on the bar on expectations

Comments

@T0mstone
Copy link

T0mstone commented Feb 9, 2024

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.

@epage epage added C-enhancement Category: Raise on the bar on expectations A-edit Area: TOML editing API labels Feb 9, 2024
@epage
Copy link
Member

epage commented Feb 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edit Area: TOML editing API C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants