mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
Replace a bunch of Into impls with Froms
This commit is contained in:
parent
7d004c48b1
commit
eadb28b95d
6 changed files with 51 additions and 51 deletions
|
@ -502,11 +502,11 @@ pub enum RocCallResult<T> {
|
|||
Failure(*mut c_char),
|
||||
}
|
||||
|
||||
impl<T: Sized> Into<Result<T, &'static str>> for RocCallResult<T> {
|
||||
fn into(self) -> Result<T, &'static str> {
|
||||
impl<T: Sized> From<RocCallResult<T>> for Result<T, &'static str> {
|
||||
fn from(call_result: RocCallResult<T>) -> Self {
|
||||
use RocCallResult::*;
|
||||
|
||||
match self {
|
||||
match call_result {
|
||||
Success(value) => Ok(value),
|
||||
Failure(failure) => Err({
|
||||
let msg = unsafe {
|
||||
|
@ -529,11 +529,11 @@ impl<T: Sized> Into<Result<T, &'static str>> for RocCallResult<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, T: Sized + Copy> Into<Result<T, &'a str>> for &'a RocCallResult<T> {
|
||||
fn into(self) -> Result<T, &'a str> {
|
||||
impl<'a, T: Sized + Copy> From<&'a RocCallResult<T>> for Result<T, &'a str> {
|
||||
fn from(call_result: &'a RocCallResult<T>) -> Self {
|
||||
use RocCallResult::*;
|
||||
|
||||
match self {
|
||||
match call_result {
|
||||
Success(value) => Ok(*value),
|
||||
Failure(failure) => Err({
|
||||
let msg = unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue