mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-12 07:48:29 +00:00
Every path that drains the stream (`fetch_one`, `fetch_next_batch`, `fetch_all`, `rowcount`) moved the cursor to `Closed` by hand, each re-reading the command tag and moving the column names across. Pull that into one `close_drained` helper. This also removes the re-borrow dance in `fetch_next_batch`'s exhausted arm and the free `rows_affected` function, which shared its name with the trait method and the `RowStream` inherent method it wrapped. Map stream errors through the module's existing `pg_err_to_py` rather than a second ad hoc message format, taking the error by value since every caller owns it. Drop the `#[allow(dead_code)]` on `Closed::description`: the enum is public, so the lint never fired. Add the licence header the other files in the crate carry. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EvkFDjwNGBQcaxtQQ1YoUD