exercism / exercism/rust

decimal: replace homebuilt try_from with FromStr impl

オープン
#1,037 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
1.8k
フォーク
548
平均マージ
13時間 3分
マージ済み PR(30日)
2

説明

https://github.com/exercism/rust/blob/9ad579f44024e459656d9646df9e8f0b33a3af13/exercises/decimal/example.rs#L30

It's more idiomatic and expressive to `impl FromStr for Decimal` instead of using a custom parse method. This is very slightly harder for the students, but it makes usage much nicer:

```diff
- let decimal = Decimal.try_from("123.45")?;
+ let decimal: Decimal = "123.45".parse()?;
```

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

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

評価

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

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

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