4 ms·
>There's really no easier way to express "double newline" in Rust than this thing which requires that the reader parse a "lazy static", a parametrized type, an
by coldtea 8y ago
>There's really no easier way to express "double newline" in Rust than this thing which requires that the reader parse a "lazy static", a parametrized type, an explicit type conversion and a library utility? Why not?
The code doesn't express 'double newline'. That would be just the "\r\n\r\n".as_bytes()
The code lazily initializes an TwoWaySearcher to parse such double newlines.
- steveklabnik 8y agoAlso note that b”” is nicer than .as_bytes()