Skip to content

Commit c650155

Browse files
committed
Fix QualifiedName::default() incorrectly creating QualifiedName with empty separator
1 parent ba13f6e commit c650155

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

rust/src/qualified_name.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use std::ops::{Index, IndexMut};
3535
/// let qn = QualifiedName::new_with_separator(["a", "b", "c"], ".");
3636
/// assert_eq!(qn.to_string(), "a.b.c");
3737
/// ```
38-
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
38+
#[derive(Debug, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
3939
pub struct QualifiedName {
4040
// TODO: Make this Option<String> where default is "::".
4141
pub separator: String,
@@ -177,6 +177,12 @@ impl QualifiedName {
177177
}
178178
}
179179

180+
impl Default for QualifiedName {
181+
fn default() -> Self {
182+
Self::new(Vec::<String>::new())
183+
}
184+
}
185+
180186
impl From<String> for QualifiedName {
181187
fn from(value: String) -> Self {
182188
Self {

0 commit comments

Comments
 (0)