clippy::must_use_candidate

This commit is contained in:
gwenn
2022-01-05 19:40:31 +01:00
committed by Thom Chiovoloni
parent bcfe99578b
commit 406ac6a7fc
12 changed files with 36 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ pub struct Error {
}
impl Error {
#[must_use]
pub fn new(result_code: c_int) -> Error {
let code = match result_code & 0xff {
super::SQLITE_INTERNAL => ErrorCode::InternalMalfunction,
@@ -192,6 +193,7 @@ const SQLITE_WARNING_AUTOINDEX: c_int = SQLITE_WARNING | (1 << 8);
const SQLITE_AUTH_USER: c_int = super::SQLITE_AUTH | (1 << 8);
#[must_use]
pub fn code_to_str(code: c_int) -> &'static str {
match code {
super::SQLITE_OK => "Successful result",

View File

@@ -12,10 +12,12 @@ use std::mem;
mod error;
#[must_use]
pub fn SQLITE_STATIC() -> sqlite3_destructor_type {
None
}
#[must_use]
pub fn SQLITE_TRANSIENT() -> sqlite3_destructor_type {
Some(unsafe { mem::transmute(-1isize) })
}