Skip to content

Commit 9771472

Browse files
committed
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
1 parent 9723fff commit 9771472

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎crates/stdlib/src/csv.rs‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,15 +1293,12 @@ mod _csv {
12931293

12941294
#[pymethod]
12951295
fn writerow(&self, row: PyObjectRef, vm: &VirtualMachine) -> PyResult {
1296-
if matches!(self.dialect.quoting, QuoteStyle::None) {
1297-
return self.writerow_quote_none(row, vm);
1298-
}
1299-
1300-
if matches!(
1301-
self.dialect.quoting,
1302-
QuoteStyle::Strings | QuoteStyle::Notnull
1303-
) {
1304-
return self.writerow_quoted_strings(row, vm);
1296+
match self.dialect.quoting {
1297+
QuoteStyle::None => return self.writerow_quote_none(row, vm),
1298+
QuoteStyle::Strings | QuoteStyle::Notnull => {
1299+
return self.writerow_quoted_strings(row, vm);
1300+
}
1301+
_ => {}
13051302
}
13061303

13071304
let mut state = self.state.lock();

0 commit comments

Comments
 (0)