From 02ca7e8a5d529feaec1b4722ed064727c379fda1 Mon Sep 17 00:00:00 2001 From: wanglei13866 Date: Tue, 8 Oct 2024 15:11:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hostcalls.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hostcalls.rs b/src/hostcalls.rs index 3fab359a..682b4977 100644 --- a/src/hostcalls.rs +++ b/src/hostcalls.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::f32::consts::E; use crate::dispatcher; use crate::types::*; use std::ptr::{null, null_mut}; @@ -271,7 +270,7 @@ pub fn get_map_value(map_type: MapType, key: &str) -> Result, Sta Ok(string) => Ok(Some(string)), // Successfully converted to String Err(e) => { error!("[get_map_value] Failed to convert to UTF-8 string: {}", e); - Err(Status::BadArgument) // Return an appropriate error + Err(Status::SerializationFailure) // Return an appropriate error } } } else { @@ -1298,7 +1297,6 @@ pub fn increment_metric(metric_id: u32, offset: i64) -> Result<(), Status> { mod utils { use crate::types::Bytes; use std::convert::TryFrom; - use std::ptr::replace; use log::error; pub(super) fn serialize_property_path(path: Vec<&str>) -> Bytes {