whitfin / runiq

An efficient way to filter duplicate lines from input, à la uniq.
MIT License
209 stars 23 forks source link

Fix a few small lint errors #4

Closed foxbenjaminfox closed 5 years ago

foxbenjaminfox commented 5 years ago

This is a fix for two small clippy lint errors, as well as a small typo in a comment.

It also hoists the eol variable from #3 out into a constant.

whitfin commented 5 years ago

This seems fine to me; I'm curious what the point of hoisting EOL is though?

foxbenjaminfox commented 5 years ago

It feels cleaner to do it that way, because logically this is a constant. It's the kind of thing that clippy doesn't currently catch, but in theory you could imagine a more advanced future version of clippy that does.

(Also, no point in allocating it space on the stack when we don't need to, although the difference there is usually trivial, and especially so in this case where the value in question is one single byte.)

whitfin commented 5 years ago

@foxbenjaminfox sure, fair enough!