Skip to content

Commit ed06007

Browse files
committed
Merge pull request #507 from yutannihilation/inserter-types
chore: Let Inserter accept &String and &Vec<u8>
2 parents 84cc97e + b68f2d6 commit ed06007

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/duckdb/src/core/vector.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ impl Inserter<&str> for FlatVector {
144144
}
145145
}
146146

147+
impl Inserter<&String> for FlatVector {
148+
fn insert(&self, index: usize, value: &String) {
149+
self.insert(index, value.as_str());
150+
}
151+
}
152+
147153
impl Inserter<&[u8]> for FlatVector {
148154
fn insert(&self, index: usize, value: &[u8]) {
149155
let value_size = value.len();
@@ -159,6 +165,12 @@ impl Inserter<&[u8]> for FlatVector {
159165
}
160166
}
161167

168+
impl Inserter<&Vec<u8>> for FlatVector {
169+
fn insert(&self, index: usize, value: &Vec<u8>) {
170+
self.insert(index, value.as_slice());
171+
}
172+
}
173+
162174
/// A list vector.
163175
pub struct ListVector {
164176
/// ListVector does not own the vector pointer.

0 commit comments

Comments
 (0)