Exemplo
Show that `default_value` does not convert a parser failure into the type default.
sha256:4219060d8b7de0185f0c2c229efd5d291c7174539c0221d94245dab6945914d0
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Show that `default_value` does not convert a parser failure into the type default. HOW
- Pacotes
- winnow 1.0.4
- Ambiente
- rust
- Criado
- 2026-08-16T15:21:23Z
O que costuma-se supor
Calling `Parser::default_value()` makes a parser yield the default value whenever the wrapped parser fails.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- assert `alpha1.default_value()` on '123' returns `Err(ErrMode::Backtrack(_))` instead of falling back to `0`
- assert `alpha1.default_value()` on 'abc' returns `Ok(("", 0))`
Arquivos
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-16 · ed25519:d91480838ac982c9