You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "martin-g (via GitHub)" <gi...@apache.org> on 2026/01/27 08:08:39 UTC
Re: [PR] chore: Less cloning while dealing with ResolvedSchema [avro-rs]
martin-g commented on code in PR #443:
URL: https://github.com/apache/avro-rs/pull/443#discussion_r2730750791
##########
avro/src/schema/resolve.rs:
##########
@@ -69,31 +70,31 @@ impl<'s> ResolvedSchema<'s> {
known_schemata: &'n NamesRef<'n>,
) -> AvroResult<Self> {
let names = HashMap::new();
- let mut rs = ResolvedSchema {
- names_ref: names,
+ let rs = ResolvedSchema {
+ names_ref: RefCell::new(names),
schemata: schemata_to_resolve,
};
rs.resolve(rs.get_schemata(), enclosing_namespace, Some(known_schemata))?;
Review Comment:
This line here requires the interior mutability for `names_ref`. There are both mutable and immutable references to `rs`...
I would be happy to revert the changes related to `names_ref` if possible.
--
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: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org