From 341ead095877bdd67e3010a82c466004df697fe0 Mon Sep 17 00:00:00 2001 From: jerryq <1397200108@qq.com> Date: Thu, 24 Jul 2025 19:03:27 +0800 Subject: [PATCH] Rename `PgLTree::from` to `from_labels` and add `From>` implementation --- 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 531f506562..68e0bb305c 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 {