Skip to content

Commit

Permalink
Update rust-toolchain to nightly-2022-04-29 (#1888)
Browse files Browse the repository at this point in the history
* Update rust-toolchain version
* Fix clippy warnings
  • Loading branch information
Remoun Metyas authored May 2, 2022
1 parent 83dcf52 commit 45db2c7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docker/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2022-01-10
nightly-2022-04-29
4 changes: 2 additions & 2 deletions mobilecoind/src/utxo_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ impl From<&UnspentTxOut> for UtxoId {
fn from(src: &UnspentTxOut) -> Self {
// The key image uniquely identifies a TxOut, which uniquely identifies an
// UnspentTxOut.
Self::from(&src.key_image)
(&src.key_image).into()
}
}

impl From<&KeyImage> for UtxoId {
fn from(src: &KeyImage) -> Self {
Self::from(src.as_bytes())
src.as_bytes().into()
}
}

Expand Down
21 changes: 0 additions & 21 deletions sgx/types/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use core::default::Default;
use core::mem::zeroed;
use error::*;
use marker::ContiguousMemory;

Expand Down Expand Up @@ -1138,23 +1137,3 @@ pub const SL_DEFAULT_FALLBACK_RETRIES: ::uint32_t = 20000;
pub const SL_DEFAULT_SLEEP_RETRIES: ::uint32_t = 20000;
pub const SL_DEFUALT_MAX_TASKS_QWORDS: ::uint32_t = 1;
pub const SL_MAX_TASKS_MAX_QWORDS: ::uint32_t = 8;

pub const _SGX_USWITCHLESS_WORKER_EVENT_NUM: ::size_t = 4;

pub struct sgx_uswitchless_config_t {
pub switchless_calls_pool_size_qwords: ::uint32_t,
pub num_uworkers: ::uint32_t,
pub num_tworkers: ::uint32_t,
pub retries_before_fallback: ::uint32_t,
pub retries_before_sleep: ::uint32_t,
pub callback_func: [sgx_uswitchless_worker_callback_t; _SGX_USWITCHLESS_WORKER_EVENT_NUM],
}

impl Default for sgx_uswitchless_config_t {
fn default() -> sgx_uswitchless_config_t {
let mut config: sgx_uswitchless_config_t = unsafe{ zeroed() };
config.num_uworkers = 1;
config.num_tworkers = 1;
config
}
}
22 changes: 11 additions & 11 deletions transaction/std/src/memo/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ macro_rules! impl_memo_enum {
}

// Try to match memo type from src.get_memo_type
impl TryFrom<&crate::MemoPayload> for $enum_name {
type Error = crate::MemoDecodingError;
fn try_from(src: &crate::MemoPayload) -> Result<Self, Self::Error> {
impl TryFrom<&$crate::MemoPayload> for $enum_name {
type Error = $crate::MemoDecodingError;
fn try_from(src: &$crate::MemoPayload) -> Result<Self, Self::Error> {
let memo_type_bytes: [u8; 2] = *src.get_memo_type();

match memo_type_bytes {
$(<$memo_type as crate::RegisteredMemoType>::MEMO_TYPE_BYTES => Ok($enum_name::$memo_name(<$memo_type>::from(src.get_memo_data()))),)+
_ => Err(crate::MemoDecodingError::UnknownMemoType(memo_type_bytes))
$(<$memo_type as $crate::RegisteredMemoType>::MEMO_TYPE_BYTES => Ok($enum_name::$memo_name(<$memo_type>::from(src.get_memo_data()))),)+
_ => Err($crate::MemoDecodingError::UnknownMemoType(memo_type_bytes))
}
}
}

// Implement From<$enum_name> for MemoPayload
impl From<$enum_name> for crate::MemoPayload {
fn from(src: $enum_name) -> crate::MemoPayload {
impl From<$enum_name> for $crate::MemoPayload {
fn from(src: $enum_name) -> $crate::MemoPayload {
match src {
$($enum_name::$memo_name(memo) => memo.into(),)+
}
Expand All @@ -75,10 +75,10 @@ macro_rules! impl_memo_enum {
#[macro_export]
macro_rules! impl_memo_type_conversions {
($memo_type: ty) => {
impl From<$memo_type> for crate::MemoPayload {
fn from(src: $memo_type) -> crate::MemoPayload {
crate::MemoPayload::new(
<$memo_type as crate::RegisteredMemoType>::MEMO_TYPE_BYTES,
impl From<$memo_type> for $crate::MemoPayload {
fn from(src: $memo_type) -> $crate::MemoPayload {
$crate::MemoPayload::new(
<$memo_type as $crate::RegisteredMemoType>::MEMO_TYPE_BYTES,
src.into(),
)
}
Expand Down

0 comments on commit 45db2c7

Please sign in to comment.