progval commented on code in PR #6266:
URL: https://github.com/apache/arrow-rs/pull/6266#discussion_r1771827398
##########
object_store/src/delimited.rs:
##########
@@ -125,8 +124,12 @@ impl LineDelimiter {
/// Returns `true` if there is no remaining data to be read
fn finish(&mut self) -> Result<bool> {
if !self.remainder.is_empty() {
- ensure!(!self.is_quote, UnterminatedStringSnafu);
- ensure!(!self.is_quote, TrailingEscapeSnafu);
+ if self.is_quote {
+ return Err(Error::UnterminatedString.into());
+ }
+ if self.is_escape {
+ return Err(Error::TrailingEscape.into());
+ }
Review Comment:
```suggestion
if self.is_quote {
Err(Error::UnterminatedString)?;
}
if self.is_escape {
Err(Error::TrailingEscape)?;
}
```
Looks a bit simpler.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]