Skip to content

Commit 82f247c

Browse files
authored
fix: the default behaviour is not aligned with the docs (#81)
In the docs, there is the following snippet: ``` //! StreamBodyAs::csv(my_source_stream()) //! // Which is the same as: //! // StreamBodyWith::new(CsvStreamFormat::new( //! // true, // with_header //! // b',' // CSV delimiter //! //), my_source_stream()) ``` Which is incorrect given the current implementation. My proposal is to use the `default` implementation for the `CsvStreamFormat` which aligns with the docs.
1 parent d2c5f2b commit 82f247c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/csv_format.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ impl<'a> StreamBodyAs<'a> {
156156
T: Serialize + Send + Sync + 'static,
157157
S: Stream<Item = T> + 'a + Send,
158158
{
159-
Self::new(
160-
CsvStreamFormat::new(false, b','),
161-
stream.map(Ok::<T, axum::Error>),
162-
)
159+
Self::new(CsvStreamFormat::default(), stream.map(Ok::<T, axum::Error>))
163160
}
164161

165162
pub fn csv_with_errors<S, T, E>(stream: S) -> Self

0 commit comments

Comments
 (0)