From c01f51330abc50dca6714bd73eff0313aa353b8c Mon Sep 17 00:00:00 2001 From: jerryq <1397200108@qq.com> Date: Fri, 22 Aug 2025 13:11:35 +0800 Subject: [PATCH] Rename `PgLTree::from` to `from_labels` and add `From>` implementation (#3949) --- sqlx-postgres/src/types/ltree.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sqlx-postgres/src/types/ltree.rs b/sqlx-postgres/src/types/ltree.rs index 531f5065..68e0bb30 100644 --- a/sqlx-postgres/src/types/ltree.rs +++ b/sqlx-postgres/src/types/ltree.rs @@ -96,7 +96,7 @@ impl PgLTree { } /// creates ltree from a [`Vec`] - pub fn from(labels: Vec) -> Self { + pub fn from_labels(labels: Vec) -> Self { Self { labels } } @@ -138,6 +138,12 @@ impl PgLTree { } } +impl From> for PgLTree { + fn from(labels: Vec) -> Self { + Self { labels } + } +} + impl FromIterator for PgLTree { fn from_iter>(iter: T) -> Self { Self {