Alex H
Alex H
Yes, that works. The example program now just fails cleanly with `EINVAL` instead of segfaulting. 👍 I suggest mentioning in the documentation for `nix::sys::socket::sockopt::SockType` that it will fail with `EINVAL`...
See also #2097, another use case for this. Thanks for working on it!
Note that the conversions to and from `std::time` types can also panic. These are especially insidious. Consider this: ```rust fn example(dt: impl Into) { let dt = dt.into(); // …do...
@pitdicker Ok, I have opened #1421.
When `csv::Reader` reads into some `record: csv::StringRecord`, then `record.position().unwrap().line()` is also incorrect if CRLF line endings are used.
As a workaround, line numbers are reported correctly if carriage returns are stripped out of the input before feeding it to the CSV parser. Here's a simple reader adapter that...