Exchange's Serialize counts through the iterator #20

Closed
opened 2026-08-14 23:58:34 +00:00 by rosa · 0 comments
Owner

Exchange's Serialize (src/serde.rs:543) sizes the map through the
iterator:

let mut table = serializer.serialize_map(Some(self.iter().len()))?;

Exchange::len (src/exchange.rs:557) arrived in 0.11 and answers the same
question directly. MoneyBag's Serialize (src/serde.rs:267) already reads
self.len(), so the two impls state the same thing two ways.

Use self.len().

`Exchange`'s `Serialize` (`src/serde.rs:543`) sizes the map through the iterator: ```rust let mut table = serializer.serialize_map(Some(self.iter().len()))?; ``` `Exchange::len` (`src/exchange.rs:557`) arrived in 0.11 and answers the same question directly. `MoneyBag`'s `Serialize` (`src/serde.rs:267`) already reads `self.len()`, so the two impls state the same thing two ways. Use `self.len()`.
rosa closed this issue 2026-08-15 02:51:38 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rosa/lucre#20
No description provided.