syscalls icon indicating copy to clipboard operation
syscalls copied to clipboard

Don't panic on From i32

Open rusty-snake opened this issue 1 year ago • 0 comments

Previous discussed in #41 but closed w/o result.

https://doc.rust-lang.org/std/convert/trait.From.html says:

Note: This trait must not fail. The From trait is intended for perfect conversions. If the conversion can fail or is not perfect, use TryFrom.

[…] the general expectation is that the conversions should typically be restricted as follows:

  • The conversion is infallible: if the conversion can fail, use TryFrom instead; don’t provide a From impl that panics.

rusty-snake avatar Aug 08 '24 10:08 rusty-snake