Skip to content

Commit 341ead0

Browse files
committed
Rename PgLTree::from to from_labels and add From<Vec<PgLTreeLabel>> implementation
1 parent 24317d5 commit 341ead0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sqlx-postgres/src/types/ltree.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl PgLTree {
9696
}
9797

9898
/// creates ltree from a [`Vec<PgLTreeLabel>`]
99-
pub fn from(labels: Vec<PgLTreeLabel>) -> Self {
99+
pub fn from_labels(labels: Vec<PgLTreeLabel>) -> Self {
100100
Self { labels }
101101
}
102102

@@ -138,6 +138,12 @@ impl PgLTree {
138138
}
139139
}
140140

141+
impl From<Vec<PgLTreeLabel>> for PgLTree {
142+
fn from(labels: Vec<PgLTreeLabel>) -> Self {
143+
Self { labels }
144+
}
145+
}
146+
141147
impl FromIterator<PgLTreeLabel> for PgLTree {
142148
fn from_iter<T: IntoIterator<Item = PgLTreeLabel>>(iter: T) -> Self {
143149
Self {

0 commit comments

Comments
 (0)