Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Keep csv quote-style dispatch coherent
Review feedback pointed out that adjacent branches selected behavior from the same quoting discriminator. Use one match so future quote-style additions are routed in a single place.

Constraint: RustPython review requested merging adjacent quote-style checks.
Confidence: high
Scope-risk: narrow
Tested: cargo fmt --check
Tested: target/release/rustpython extra_tests/snippets/stdlib_csv.py
Tested: target/release/rustpython -m test test_csv
Tested: PATH=/tmp/pyshim:$PATH prek run --all-files
Tested: RUST_TEST_THREADS=1 cargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher -- --test-threads=1
Tested: cargo clippy --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --all-targets
Assisted-by: Codex:gpt-5.5
  • Loading branch information
doma17 committed Jul 2, 2026
commit 97714729fa46fa25984d220ee90a41fa697c9c3c
15 changes: 6 additions & 9 deletions crates/stdlib/src/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,15 +1293,12 @@ mod _csv {

#[pymethod]
fn writerow(&self, row: PyObjectRef, vm: &VirtualMachine) -> PyResult {
if matches!(self.dialect.quoting, QuoteStyle::None) {
return self.writerow_quote_none(row, vm);
}

if matches!(
self.dialect.quoting,
QuoteStyle::Strings | QuoteStyle::Notnull
) {
return self.writerow_quoted_strings(row, vm);
match self.dialect.quoting {
QuoteStyle::None => return self.writerow_quote_none(row, vm),
QuoteStyle::Strings | QuoteStyle::Notnull => {
return self.writerow_quoted_strings(row, vm);
}
_ => {}
}

let mut state = self.state.lock();
Expand Down
Loading