Skip to content

Commit 5d3ec72

Browse files
committed
Minor: remove string copy from Column::from_qualified_name
1 parent 378b9ee commit 5d3ec72

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

datafusion/common/src/column.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,21 @@ impl Column {
109109
/// `foo.BAR` would be parsed to a reference to relation `foo`, column name `bar` (lower case)
110110
/// where `"foo.BAR"` would be parsed to a reference to column named `foo.BAR`
111111
pub fn from_qualified_name(flat_name: impl Into<String>) -> Self {
112-
let flat_name: &str = &flat_name.into();
113-
Self::from_idents(&mut parse_identifiers_normalized(flat_name, false))
112+
let flat_name = flat_name.into();
113+
Self::from_idents(&mut parse_identifiers_normalized(&flat_name, false))
114114
.unwrap_or_else(|| Self {
115115
relation: None,
116-
name: flat_name.to_owned(),
116+
name: flat_name,
117117
})
118118
}
119119

120120
/// Deserialize a fully qualified name string into a column preserving column text case
121121
pub fn from_qualified_name_ignore_case(flat_name: impl Into<String>) -> Self {
122-
let flat_name: &str = &flat_name.into();
123-
Self::from_idents(&mut parse_identifiers_normalized(flat_name, true))
122+
let flat_name = flat_name.into();
123+
Self::from_idents(&mut parse_identifiers_normalized(&flat_name, true))
124124
.unwrap_or_else(|| Self {
125125
relation: None,
126-
name: flat_name.to_owned(),
126+
name: flat_name,
127127
})
128128
}
129129

0 commit comments

Comments
 (0)