Skip to content

Commit

Permalink
feat(serialization): cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Dec 13, 2024
1 parent e16d2b7 commit d2e2a3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions examples/src/main/java/io/zenoh/ZBytesExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,19 @@ public static void main(String[] args) {
// Map example
Map<String, Integer> input15 = Map.of("one", 1, "two", 2, "three", 3);
var zbytes15 = zSerialize(input15, new TypeToken<>() {});
Map<String, Integer> output15 = zDeserialize(zbytes15, new TypeToken<>() {
});
Map<String, Integer> output15 = zDeserialize(zbytes15, new TypeToken<>() {});
assert input15.equals(output15);

// Nested List example
List<List<Integer>> input18 = List.of(List.of(1, 2, 3));
var zbytes18 = zSerialize(input18, new TypeToken<>() {});
List<List<Integer>> output18 = zDeserialize(zbytes18, new TypeToken<>() {
});
List<List<Integer>> output18 = zDeserialize(zbytes18, new TypeToken<>() {});
assert input18.equals(output18);

// Combined types example
List<Map<String, Integer>> input19 = List.of(Map.of("a", 1, "b", 2));
var zbytes19 = zSerialize(input19, new TypeToken<>() {});
List<Map<String, Integer>> output19 = zDeserialize(zbytes19, new TypeToken<>() {
});
List<Map<String, Integer>> output19 = zDeserialize(zbytes19, new TypeToken<>() {});
assert input19.equals(output19);
}
}
2 changes: 1 addition & 1 deletion zenoh-jni/src/zbytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn decode_token_type(env: &mut JNIEnv, type_obj: JObject) -> ZResult<JavaType> {
return Ok(JavaType::List(Box::new(decode_token_type(env, arg1)?)));
}

return Err(zerror!("Unsupported type: {}", qualified_name));
Err(zerror!("Unsupported type: {}", qualified_name))
}
}
}
Expand Down

0 comments on commit d2e2a3d

Please sign in to comment.