mirror of
https://github.com/fluencelabs/fluid
synced 2025-04-24 22:32:16 +00:00
more optimize
This commit is contained in:
parent
b2fdcd889e
commit
3b1d45a4d7
@ -5,15 +5,11 @@ pub fn query(bytes: &str) -> AppResult<String> {
|
|||||||
let response = sqlite::call(bytes.as_bytes());
|
let response = sqlite::call(bytes.as_bytes());
|
||||||
|
|
||||||
// Decode query result to a utf8 string
|
// Decode query result to a utf8 string
|
||||||
match String::from_utf8(response) {
|
String::from_utf8(response).map_err(|e| {
|
||||||
Ok(string) => Ok(string),
|
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
||||||
Err(err) => {
|
err_msg(&format!(
|
||||||
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
"unable to decode result from bytes {:#x?}: {}",
|
||||||
Err(err_msg(&format!(
|
bytes, e
|
||||||
"unable to decode result from bytes {:#x?}: {}",
|
))
|
||||||
bytes, err
|
})
|
||||||
)))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,11 @@ pub fn query(bytes: &str) -> AppResult<String> {
|
|||||||
let response = sqlite::call(bytes.as_bytes());
|
let response = sqlite::call(bytes.as_bytes());
|
||||||
|
|
||||||
// Decode query result to a utf8 string
|
// Decode query result to a utf8 string
|
||||||
match String::from_utf8(response) {
|
String::from_utf8(response).map_err(|e| {
|
||||||
Ok(string) => Ok(string),
|
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
||||||
Err(err) => {
|
err_msg(&format!(
|
||||||
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
"unable to decode result from bytes {:#x?}: {}",
|
||||||
Err(err_msg(&format!(
|
bytes, e
|
||||||
"unable to decode result from bytes {:#x?}: {}",
|
))
|
||||||
bytes, err
|
})
|
||||||
)))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user