Skip to content

Commit

Permalink
Merge pull request #830 from epage/into
Browse files Browse the repository at this point in the history
feat(item): Add conversions from item type to Item
  • Loading branch information
epage authored Feb 10, 2025
2 parents f550dbf + 18d0957 commit ec5c13d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/toml_edit/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,18 @@ impl<'b> From<&'b Item> for Item {
}
}

impl From<Table> for Item {
fn from(s: Table) -> Self {
Item::Table(s)
}
}

impl From<ArrayOfTables> for Item {
fn from(s: ArrayOfTables) -> Self {
Item::ArrayOfTables(s)
}
}

impl<V: Into<Value>> From<V> for Item {
fn from(s: V) -> Self {
Item::Value(s.into())
Expand Down

0 comments on commit ec5c13d

Please sign in to comment.