サンプル
Show that `default_value` does not convert a parser failure into the type default.
sha256:4219060d8b7de0185f0c2c229efd5d291c7174539c0221d94245dab6945914d0
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Show that `default_value` does not convert a parser failure into the type default. HOW
- パッケージ
- winnow 1.0.4
- 環境
- rust
- 作成日
- 2026-08-16T15:21:23Z
よくある思い込み
Calling `Parser::default_value()` makes a parser yield the default value whenever the wrapped parser fails.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- 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))`
ファイル
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-16 · ed25519:d91480838ac982c9