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

Array of Tables remove does not return the removed table #712

Open
sleepycatcoding opened this issue Apr 8, 2024 · 0 comments
Open

Array of Tables remove does not return the removed table #712

sleepycatcoding opened this issue Apr 8, 2024 · 0 comments
Labels
A-edit Area: TOML editing API C-bug Category: Things not working as expected M-breaking-change Meta: Implementing or merging this will introduce a breaking change.

Comments

@sleepycatcoding
Copy link

I am trying to push a specific table to the top in the array, but unable to do so.

Example code:

fn push_to_top(array: &mut ArrayOfTables, index: usize) {
    let table = array.remove(index); // <--- This does not return the removed table.
    array.push(table);
}

toml_edit::Array already seems to return the removed value, so this would be nice for API consistency.

@sleepycatcoding sleepycatcoding changed the title array of tables remove does not return the removed table Array of Tables remove does not return the removed table Apr 8, 2024
@epage epage added M-breaking-change Meta: Implementing or merging this will introduce a breaking change. A-edit Area: TOML editing API C-bug Category: Things not working as expected labels Apr 9, 2024
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-bug Category: Things not working as expected M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Projects
None yet
Development

No branches or pull requests

2 participants