mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-28 06:49:19 +00:00
Merge pull request #2255 from zeonzip/clarify_errors_4_return
Clarify how to find return type of error4
This commit is contained in:
commit
6765a0b61a
@ -10,6 +10,7 @@ struct PositiveNonzeroInteger(u64);
|
|||||||
impl PositiveNonzeroInteger {
|
impl PositiveNonzeroInteger {
|
||||||
fn new(value: i64) -> Result<Self, CreationError> {
|
fn new(value: i64) -> Result<Self, CreationError> {
|
||||||
// TODO: This function shouldn't always return an `Ok`.
|
// TODO: This function shouldn't always return an `Ok`.
|
||||||
|
// Read the tests below to clarify what should be returned.
|
||||||
Ok(Self(value as u64))
|
Ok(Self(value as u64))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user