Skip to content

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

Open
@sleepycatcoding

Description

@sleepycatcoding

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-editArea: TOML editing APIC-bugCategory: Things not working as expectedM-breaking-changeMeta: Implementing or merging this will introduce a breaking change.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions