chaokunyang commented on code in PR #2712:
URL: https://github.com/apache/fory/pull/2712#discussion_r2412363873
##########
rust/fory-core/src/resolver/type_resolver.rs:
##########
@@ -549,17 +521,17 @@ impl TypeResolver {
self.name_serializer_map.get(&key)
}
- pub fn get_ext_harness(&self, id: u32) -> Option<&ExtHarness> {
- self.ext_serializer_map.get(&id)
+ pub fn get_ext_harness(&self, id: u32) -> &Harness {
+ self.serializer_map
+ .get(&id)
+ .unwrap_or_else(|| panic!("ext type must be registered in both
peers"))
}
- pub fn get_ext_name_harness(
- &self,
- namespace: &MetaString,
- type_name: &MetaString,
- ) -> Option<&ExtHarness> {
+ pub fn get_ext_name_harness(&self, namespace: &MetaString, type_name:
&MetaString) -> &Harness {
let key = (namespace.clone(), type_name.clone());
- self.ext_name_serializer_map.get(&key)
+ self.name_serializer_map
+ .get(&key)
+ .unwrap_or_else(|| panic!("named_ext type must be registered in
both peers"))
Review Comment:
```suggestion
.expect("named_ext type must be registered in both peers")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]