BurntSushi / rust-csv

A CSV parser for Rust, with Serde support.
The Unlicense
1.72k stars 219 forks source link

Add `Writer::get_ref` #322

Closed threecgreen closed 1 year ago

threecgreen commented 1 year ago

It's useful to be able to access the underlying writer without dropping Writer, for example, checking the position of an std::io::Cursor.

BurntSushi commented 1 year ago

get_ref seems okay, but I'm less sure about get_mut. It looks like a footgun to me, although a Reader does have it.

Does get_ref unblock your specific use case? If so, let's just go with that for now.

threecgreen commented 1 year ago

Thanks for the quick response!

Yes, get_ref unblocks my specific use case.

BurntSushi commented 1 year ago

This PR is on crates.io in csv 1.2.2.

threecgreen commented 1 year ago

Thank you!