Ejemplo
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
- Paquetes
- winnow 1.0.4
- Entorno
- rust
- Creado
- 2026-08-16T15:21:23Z
Lo que suele suponerse
Calling `Parser::default_value()` makes a parser yield the default value whenever the wrapped parser fails.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
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))`
Archivos
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-16 · ed25519:d91480838ac982c9