Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Mar 5, 2025
1 parent 3cb7e64 commit 916638f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/polars-io/src/cloud/adaptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl WriterState {
self.try_with_writer(func)
},
},
Self::Err(e) => Err(std::io::Error::new(e.kind(), e.to_string())),
Self::Err(e) => Err(clone_io_err(e)),
}
}
}
Expand Down Expand Up @@ -149,7 +149,7 @@ impl tokio::io::AsyncWrite for CloudWriter {
},
v => v,
},
WriterState::Err(e) => Poll::Ready(Err(std::io::Error::new(e.kind(), e.to_string()))),
WriterState::Err(e) => Poll::Ready(Err(clone_io_err(e))),
}
}

Expand All @@ -165,7 +165,7 @@ impl tokio::io::AsyncWrite for CloudWriter {
},
v => v,
},
WriterState::Err(e) => Poll::Ready(Err(std::io::Error::new(e.kind(), e.to_string()))),
WriterState::Err(e) => Poll::Ready(Err(clone_io_err(e))),
}
}

Expand All @@ -181,7 +181,7 @@ impl tokio::io::AsyncWrite for CloudWriter {
},
v => v,
},
WriterState::Err(e) => Poll::Ready(Err(std::io::Error::new(e.kind(), e.to_string()))),
WriterState::Err(e) => Poll::Ready(Err(clone_io_err(e))),
}
}
}
Expand All @@ -197,6 +197,10 @@ impl Drop for CloudWriter {
}
}

fn clone_io_err(e: &std::io::Error) -> std::io::Error {
std::io::Error::new(e.kind(), e.to_string())
}

#[cfg(feature = "csv")]
#[cfg(test)]
mod tests {
Expand Down

0 comments on commit 916638f

Please sign in to comment.