From f04c23570dc16893b3d9dfe4c772e6cddc9078d1 Mon Sep 17 00:00:00 2001 From: Yan Chen Date: Tue, 24 Oct 2023 17:39:43 -0700 Subject: [PATCH] fix --- Changelog.md | 3 +++ rust/candid/src/types/subtype.rs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 96d2f694..135529f3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,9 +10,12 @@ + `candid::bindings::candid` moves to `candid::pretty::candid`. `candid::pretty` moves to `candid::pretty::utils`. These modules are only available under feature flag `printer` (enabled by default). + `candid::types::number::pp_num_str` moves to `candid::utils::pp_num_str`. + `candid::types::value` module is only availble under feature flag `value`. + + `mute_warning` feature flag is removed. * `candid_parser`: used to be the `parser` and `bindings` module in `candid` crate. + Remove `FromStr` trait for `IDLArgs` and `IDLValue`. Use `parse_idl_args` and `parse_idl_value` respectively instead. + `TypeEnv.ast_to_type` becomes `candid_parser::typing::ast_to_type`. + + `candid` is re-exported in `candid_parser::candid`. + + `candid::*` is re-exported in `candid_parser`. * `ic_principal`: only for `Principal` and `PrincipalError`. ### Non-breaking changes diff --git a/rust/candid/src/types/subtype.rs b/rust/candid/src/types/subtype.rs index 2b236eb1..141b9d0e 100644 --- a/rust/candid/src/types/subtype.rs +++ b/rust/candid/src/types/subtype.rs @@ -70,11 +70,12 @@ fn subtype_( } (_, Opt(_)) => { let msg = format!("FIX ME! {t1} <: {t2} via special opt rule.\nThis means the sender and receiver type has diverged, and can cause data loss."); - Ok(match report { + match report { OptReport::Slience => (), OptReport::Warning => eprintln!("{msg}"), OptReport::Error => return Err(Error::msg(msg)), - }) + }; + Ok(()) } (Record(fs1), Record(fs2)) => { let fields: HashMap<_, _> = fs1.iter().map(|Field { id, ty }| (id, ty)).collect();