nats.rs
nats.rs copied to clipboard
Remove useless use of `Option` around `HeaderMap`
Calling HeaderMap::new
doesn't allocate, but instead creates an empty hashmap.
Considering that code already has to check whether there really were any headers inside of the HeaderMap
when the variant is Some
, the Option
around it didn't make sense.
Considering that code already has to check whether there really were any headers inside of the HeaderMap when the variant is Some, the Option around it didn't make sense.
Just a bit of trivia as to why, before we used to send HMSG if headers were Some, even if they were empty.
Boils down to this I think, Option signals semantics. Is an empty header map lighter than an empty header map?
This conflicts with #1003 pretty heavily so, may merge but not before that is merged.