seanmonstar / httparse

A push parser for the HTTP 1.x protocol in Rust.
https://docs.rs/httparse
Apache License 2.0
573 stars 113 forks source link

Correct `&` to `&&` #76

Closed spinda closed 4 years ago

spinda commented 4 years ago

& applied to two booleans is the non-short-circuiting logical AND. That works here, but && is probably what was intended.

shirshak55 commented 4 years ago

i guess it would be better if we can write test so there wouldn't be such bug?

spinda commented 4 years ago

Not possible as the behavior of the code is the same either way (& just doesn't apply short-circuiting).