Skip to content

Commit

Permalink
Add conversion from Infallible to ConversionError (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Aug 22, 2022
1 parent 5bcc5b5 commit 4c288ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion soroban-env-common/src/raw_val.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use stellar_xdr::{ScStatic, ScStatus, ScStatusType};

use super::{BitSet, Env, EnvVal, Object, Static, Status, Symbol};
use core::fmt::Debug;
use core::{convert::Infallible, fmt::Debug};

extern crate static_assertions as sa;

Expand Down Expand Up @@ -115,6 +115,12 @@ impl AsMut<RawVal> for RawVal {
#[derive(Debug, Eq, PartialEq)]
pub struct ConversionError;

impl From<Infallible> for ConversionError {
fn from(_: Infallible) -> Self {
unreachable!()
}
}

impl From<stellar_xdr::Error> for ConversionError {
fn from(_: stellar_xdr::Error) -> Self {
ConversionError
Expand Down

0 comments on commit 4c288ce

Please sign in to comment.