Skip to content

Commit 005a2d2

Browse files
committed
Move PgLTree::from to From<Vec<PgLTreeLabel>> implementation
1 parent 24317d5 commit 005a2d2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sqlx-postgres/src/types/ltree.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ impl PgLTree {
9595
Self::default()
9696
}
9797

98-
/// creates ltree from a [`Vec<PgLTreeLabel>`]
99-
pub fn from(labels: Vec<PgLTreeLabel>) -> Self {
100-
Self { labels }
101-
}
102-
10398
/// creates ltree from an iterator with checking labels
10499
// TODO: this should just be removed but I didn't want to bury it in a massive diff
105100
#[deprecated = "renamed to `try_from_iter()`"]
@@ -138,6 +133,12 @@ impl PgLTree {
138133
}
139134
}
140135

136+
impl From<Vec<PgLTreeLabel>> for PgLTree {
137+
fn from(labels: Vec<PgLTreeLabel>) -> Self {
138+
Self { labels }
139+
}
140+
}
141+
141142
impl FromIterator<PgLTreeLabel> for PgLTree {
142143
fn from_iter<T: IntoIterator<Item = PgLTreeLabel>>(iter: T) -> Self {
143144
Self {

0 commit comments

Comments
 (0)