Latest Results
Implement Default for Leader and compile-check the Rust doc examples (#449)
* fix(leader): implement Default and compile-check the doc examples
Leader had no Default implementation, so the Record::new(Leader::default())
line shown throughout the crate documentation did not compile. Reported
externally as issue #447.
The default values already existed one layer up, in PyLeader::new. Move
them into impl Default for Leader and have the PyO3 binding delegate, so
the core crate and the Python binding cannot drift apart again.
Every example showing the missing constructor sat inside an `ignore`
fence, which is why CI never caught it. Convert 119 of the 120 ignored
doctests in src/ to compile-checked fences; examples that touch the
filesystem become no_run, and one illustrative trait-impl sketch stays
ignored. That surfaced further drift between the documentation and the
API, now corrected:
- Field::get_subfields was shown taking varargs; it takes &[char]
- Record::update_subfields_where was shown taking a closure for the
subfield code; it takes a char
- FieldQuery::indicator2 was shown taking a bare char; it takes
Option<char>
- Record::matching_fields does not exist; the method is fields_matching
- RdfGraph::to_string does not exist; serialization is serialize(format)
- MarcReader is not an iterator; reading loops call read_record
- trait associated functions in AuthorityQueries need a qualified
receiver, and trait methods shadowed by inherent ones need the trait
to be exercised generically
cargo test --doc goes from 34 passing / 120 ignored to 153 passing /
1 ignored.
* fix(leader): default the leader to Unicode coding, not MARC-8
MarcWriter serializes every field value as UTF-8 and has no MARC-8
branch, so a default leader declaring MARC-8 in position 09 described an
encoding the writer never produces. A record built from Leader::default
with any non-ASCII content went out mislabelled.
Set position 09 to 'a'. This also brings the Python binding closer to
pymarc, which forces the same value in Record.as_marc() whenever
to_unicode is set -- its default.
The wider inconsistency, that the writer ignores position 09 entirely
rather than honouring or correcting it, is filed separately as bd-23j6.
* chore(beads): record the agreed encoding design on bd-23j6
UTF-8 default on write matching pymarc, MARC-8 as explicit opt-in.
Notes that the reader has the same gap in the other direction and that
encode_marc8's silent '?' substitution must be resolved before the
opt-in is safe to offer.
* chore(beads): reconcile the MARC-8 encoding beads
bd-cdey already tracked wiring MARC-8 into the writer, filed 2026-05-29.
Narrow bd-23j6 to the leader position 09 correctness bug it uniquely
covers, retitle it accordingly, and move the MARC-8 output design and the
encode_marc8 substitution blocker onto bd-cdey where they belong.
File bd-x6la for the read side, which no bead covered: the reader decodes
UTF-8 only and never consults position 09, so MARC-8 input cannot be read
correctly. Cross-link all three.
* docs(changelog): credit the reporter of the missing Leader::Default
The repository credits issue reporters in CHANGELOG.md rather than in
commit trailers. The Default entry had no such line.
Credit goes on that bullet only: the position 09 Unicode correction and
the doctest conversion were found while fixing the report, not reported. Implement Default for Leader and compile-check the Rust doc examples (#449)
* fix(leader): implement Default and compile-check the doc examples
Leader had no Default implementation, so the Record::new(Leader::default())
line shown throughout the crate documentation did not compile. Reported
externally as issue #447.
The default values already existed one layer up, in PyLeader::new. Move
them into impl Default for Leader and have the PyO3 binding delegate, so
the core crate and the Python binding cannot drift apart again.
Every example showing the missing constructor sat inside an `ignore`
fence, which is why CI never caught it. Convert 119 of the 120 ignored
doctests in src/ to compile-checked fences; examples that touch the
filesystem become no_run, and one illustrative trait-impl sketch stays
ignored. That surfaced further drift between the documentation and the
API, now corrected:
- Field::get_subfields was shown taking varargs; it takes &[char]
- Record::update_subfields_where was shown taking a closure for the
subfield code; it takes a char
- FieldQuery::indicator2 was shown taking a bare char; it takes
Option<char>
- Record::matching_fields does not exist; the method is fields_matching
- RdfGraph::to_string does not exist; serialization is serialize(format)
- MarcReader is not an iterator; reading loops call read_record
- trait associated functions in AuthorityQueries need a qualified
receiver, and trait methods shadowed by inherent ones need the trait
to be exercised generically
cargo test --doc goes from 34 passing / 120 ignored to 153 passing /
1 ignored.
* fix(leader): default the leader to Unicode coding, not MARC-8
MarcWriter serializes every field value as UTF-8 and has no MARC-8
branch, so a default leader declaring MARC-8 in position 09 described an
encoding the writer never produces. A record built from Leader::default
with any non-ASCII content went out mislabelled.
Set position 09 to 'a'. This also brings the Python binding closer to
pymarc, which forces the same value in Record.as_marc() whenever
to_unicode is set -- its default.
The wider inconsistency, that the writer ignores position 09 entirely
rather than honouring or correcting it, is filed separately as bd-23j6.
* chore(beads): record the agreed encoding design on bd-23j6
UTF-8 default on write matching pymarc, MARC-8 as explicit opt-in.
Notes that the reader has the same gap in the other direction and that
encode_marc8's silent '?' substitution must be resolved before the
opt-in is safe to offer.
* chore(beads): reconcile the MARC-8 encoding beads
bd-cdey already tracked wiring MARC-8 into the writer, filed 2026-05-29.
Narrow bd-23j6 to the leader position 09 correctness bug it uniquely
covers, retitle it accordingly, and move the MARC-8 output design and the
encode_marc8 substitution blocker onto bd-cdey where they belong.
File bd-x6la for the read side, which no bead covered: the reader decodes
UTF-8 only and never consults position 09, so MARC-8 input cannot be read
correctly. Cross-link all three.
* docs(changelog): credit the reporter of the missing Leader::Default
The repository credits issue reporters in CHANGELOG.md rather than in
commit trailers. The Default entry had no such line.
Credit goes on that bullet only: the position 09 Unicode correction and
the doctest conversion were found while fixing the report, not reported. Latest Branches
0%
ci/validate-pypi-metadata +1%
0%
© 2026 CodSpeed Technology