clear unwrap (#8605)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-07-04 20:18:53 +08:00
committed by GitHub
parent 94addb162b
commit 86ff768241
11 changed files with 54 additions and 42 deletions

View File

@@ -5,16 +5,16 @@
#![allow(non_snake_case)]
#![allow(deref_nullptr)]
use std::{
boxed::Box,
ffi::{CStr, CString},
result::Result,
};
use crate::{
allow_err, send_data, ClipboardFile, CliprdrError, CliprdrServiceContext, ResultType,
ERR_CODE_INVALID_PARAMETER, ERR_CODE_SERVER_FUNCTION_NONE, VEC_MSG_CHANNEL,
};
use hbb_common::log;
use std::{
boxed::Box,
ffi::{CStr, CString},
result::Result,
};
// only used error code will be recorded here
/// success
@@ -779,7 +779,7 @@ pub fn server_format_list(
} else {
let n = match CString::new(format.1) {
Ok(n) => n,
Err(_) => CString::new("").unwrap(),
Err(_) => CString::new("").unwrap_or_default(),
};
CLIPRDR_FORMAT {
formatId: format.0 as UINT32,