diff options
| author | Truman Kilen <t@kilen.me> | 2025-12-22 15:37:39 -0600 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-12-29 10:13:07 -0500 |
| commit | 742370bc6e18b1e3e3b42eee4fc5367dc336b785 (patch) | |
| tree | b4eb229f443077b9f65ba43a4e6378972f9e8382 /rust | |
| parent | 2ccba5081488225007810f232dbe063512ebc4bd (diff) | |
Fix QualifiedName::default() incorrectly creating QualifiedName with empty separator
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/qualified_name.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rust/src/qualified_name.rs b/rust/src/qualified_name.rs index fc362cf6..62da86b8 100644 --- a/rust/src/qualified_name.rs +++ b/rust/src/qualified_name.rs @@ -35,7 +35,7 @@ use std::ops::{Index, IndexMut}; /// let qn = QualifiedName::new_with_separator(["a", "b", "c"], "."); /// assert_eq!(qn.to_string(), "a.b.c"); /// ``` -#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] +#[derive(Debug, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] pub struct QualifiedName { // TODO: Make this Option<String> where default is "::". pub separator: String, @@ -177,6 +177,12 @@ impl QualifiedName { } } +impl Default for QualifiedName { + fn default() -> Self { + Self::new(Vec::<String>::new()) + } +} + impl From<String> for QualifiedName { fn from(value: String) -> Self { Self { |
