Skip to content

Commit

Permalink
Add clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Oct 2, 2023
1 parent 4e3de2f commit a75a17c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ic-transport-types/src/request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ impl SerializeStruct for StructSerializer {
impl SerializeMap for StructSerializer {
type Ok = Option<Sha256Hash>;
type Error = RequestIdError;
// This implementation naïvely assumes serialize_key is called before serialize_value, with no checks.
// SerializeMap's documentation states that such a case is 'allowed to panic or produce bogus results.'
fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), Self::Error>
where
T: Serialize,
Expand Down

0 comments on commit a75a17c

Please sign in to comment.