Skip to content

Commit 346986f

Browse files
authored
change Queryable as_object to return &str instead of &String (#103)
1 parent 2c99b9b commit 346986f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/query/queryable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ where
7070

7171
fn as_array(&self) -> Option<&Vec<Self>>;
7272

73-
fn as_object(&self) -> Option<Vec<(&String, &Self)>>;
73+
fn as_object(&self) -> Option<Vec<(&str, &Self)>>;
7474

7575
fn as_str(&self) -> Option<&str>;
7676

@@ -156,9 +156,9 @@ impl Queryable for Value {
156156
self.as_array()
157157
}
158158

159-
fn as_object(&self) -> Option<Vec<(&String, &Self)>> {
159+
fn as_object(&self) -> Option<Vec<(&str, &Self)>> {
160160
self.as_object()
161-
.map(|v| v.into_iter().map(|(k, v)| (k, v)).collect())
161+
.map(|v| v.into_iter().map(|(k, v)| (k.as_str(), v)).collect())
162162
}
163163

164164
fn as_str(&self) -> Option<&str> {

0 commit comments

Comments
 (0)