Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ pub fn json_api_open_key_internal<M: Manager>(
) -> *const M::V {
let ctx = Context::new(ctx);
if let Ok(h) = manager.open_key_read(&ctx, &key) {
if let Ok(v) = h.get_value() {
if let Some(v) = v {
return v;
}
if let Ok(Some(v)) = h.get_value() {
return v;
}
}
null()
Expand Down Expand Up @@ -222,7 +220,7 @@ pub fn json_api_next<M: Manager>(_: M, iter: *mut c_void) -> *const c_void {
null_mut()
} else {
let res = iter.results[iter.pos] as *const M::V as *const c_void;
iter.pos = iter.pos + 1;
iter.pos += 1;
res
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl<'a, V: SelectValue> KeyValue<'a, V> {
return acc;
}
let value = match selector.select() {
Ok(s) => s.first().map(|v| *v),
Ok(s) => s.first().copied(),
Err(_) => None,
};
acc.insert(path.get_original(), value);
Expand All @@ -197,7 +197,7 @@ impl<'a, V: SelectValue> KeyValue<'a, V> {
if path.is_legacy() {
Ok(self
.serialize_object(
self.get_first(&paths[0].get_path())?,
self.get_first(paths[0].get_path())?,
indent,
newline,
space,
Expand Down Expand Up @@ -370,8 +370,8 @@ impl<'a, V: SelectValue> KeyValue<'a, V> {
false
} else {
for k in a.keys().unwrap() {
let temp1 = a.get_key(&k);
let temp2 = b.get_key(&k);
let temp1 = a.get_key(k);
let temp2 = b.get_key(k);
match (temp1, temp2) {
(Some(a1), Some(b1)) => {
if !self.is_eqaul(a1, b1) {
Expand Down