clippy::use_self

This commit is contained in:
gwenn
2024-08-10 14:39:36 +02:00
parent 90320c9d37
commit 0c3933b68c
30 changed files with 268 additions and 271 deletions

View File

@@ -336,7 +336,7 @@ pub enum HeaderLocation {
}
impl From<HeaderLocation> for String {
fn from(header: HeaderLocation) -> String {
fn from(header: HeaderLocation) -> Self {
match header {
HeaderLocation::FromEnvironment => {
let prefix = env_prefix();

View File

@@ -64,7 +64,7 @@ pub struct Error {
impl Error {
#[must_use]
pub fn new(result_code: c_int) -> Error {
pub fn new(result_code: c_int) -> Self {
let code = match result_code & 0xff {
super::SQLITE_INTERNAL => ErrorCode::InternalMalfunction,
super::SQLITE_PERM => ErrorCode::PermissionDenied,
@@ -92,7 +92,7 @@ impl Error {
_ => ErrorCode::Unknown,
};
Error {
Self {
code,
extended_code: result_code,
}
@@ -288,13 +288,13 @@ pub enum InitError {
impl ::std::fmt::Display for InitError {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
InitError::VersionMismatch {
Self::VersionMismatch {
compile_time,
runtime,
} => {
write!(f, "SQLite version mismatch: {runtime} < {compile_time}")
}
InitError::NullFunctionPointer => {
Self::NullFunctionPointer => {
write!(f, "Some sqlite3_api_routines fields are null")
}
}