diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2019-11-05 09:49:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-05 09:49:53 +0100 |
| commit | 370d01aea7a35e9ae8b8688babba26c2b998c58e (patch) | |
| tree | 8dc4ef27ddb594b9b4d3a17d49173ce9826e231c | |
| parent | 0a284153e9f2b7b371676233888144041a7fb163 (diff) | |
| parent | e7fd580e7cd68f68cdc585a2f785d49c8fe7fefa (diff) | |
| download | rust-370d01aea7a35e9ae8b8688babba26c2b998c58e.tar.gz rust-370d01aea7a35e9ae8b8688babba26c2b998c58e.zip | |
Rollup merge of #65962 - kevincox:patch-1, r=sfackler
Fix logic in example. The example claims SuperiorThanZero and presumably Zero is not Superior than itself so it should not be allowed.
| -rw-r--r-- | src/libcore/convert.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index 3cd2337ee59..16045f64d46 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -438,16 +438,16 @@ pub trait TryInto<T>: Sized { /// ``` /// use std::convert::TryFrom; /// -/// struct SuperiorThanZero(i32); +/// struct GreaterThanZero(i32); /// -/// impl TryFrom<i32> for SuperiorThanZero { +/// impl TryFrom<i32> for GreaterThanZero { /// type Error = &'static str; /// /// fn try_from(value: i32) -> Result<Self, Self::Error> { -/// if value < 0 { -/// Err("SuperiorThanZero only accepts value superior than zero!") +/// if value <= 0 { +/// Err("GreaterThanZero only accepts value superior than zero!") /// } else { -/// Ok(SuperiorThanZero(value)) +/// Ok(GreaterThanZero(value)) /// } /// } /// } |
