actix / actix/actix-web

Parsing optional field seems to not work for numbers when not filled

オープン
#1,815 コメント 22 件 リアクション 0 件 担当者 0 名 GitHub で見る
A-web C-improvement
主要言語
Rust
スター
24.8k
フォーク
1.9k
平均マージ
23時間 10分
マージ済み PR(30日)
26

説明

Hello, I currently try to parse a form but I have a Parse error for a specific case:

```
struct TestForm {
text: Option,
number: Option
}
```

1. Whether I filled the text input field or not, it ends up being `Some("whatever") or 'None'.
2. When I fill the number input field (a html text input), It parses to `Some(123)`.
3. But when I don't fill the number field, it fails and return a `Parse error` (a `UrlencodedError::Parse` error apparently)

Same behaviour for f32 so far I've tested.

* Rust Version: 1.48.0
* Actix Web Version: 3.3.2

Thanks a lot for the help.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。