Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/connector/mssql/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn conv_params<'a>(params: &'a [Value<'a>]) -> crate::Result<Vec<&'a dyn ToS
let mut builder = Error::builder(kind);
builder.set_original_message(msg);

return Err(builder.build())
return Err(builder.build());
} else {
converted.push(param as &dyn ToSql)
}
Expand Down
3 changes: 2 additions & 1 deletion src/connector/mssql/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ impl From<tiberius::error::Error> for Error {
tiberius::error::Error::Server(e) if e.code() == 547 => {
let index = e
.message()
.split('.').next()
.split('.')
.next()
.unwrap()
.split_whitespace()
.last()
Expand Down
10 changes: 5 additions & 5 deletions src/connector/mysql/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use mysql_async::{
};
use std::convert::TryFrom;

pub fn conv_params<'a>(params: &[Value<'a>]) -> crate::Result<my::Params> {
pub fn conv_params(params: &[Value<'_>]) -> crate::Result<my::Params> {
if params.is_empty() {
// If we don't use explicit 'Empty',
// mysql crashes with 'internal error: entered unreachable code'
Expand Down Expand Up @@ -63,7 +63,7 @@ pub fn conv_params<'a>(params: &[Value<'a>]) -> crate::Result<my::Params> {
let mut builder = Error::builder(kind);
builder.set_original_message(msg);

return Err(builder.build())
return Err(builder.build());
}
#[cfg(feature = "uuid-0_8")]
Value::Uuid(u) => u.map(|u| my::Value::Bytes(u.to_hyphenated().to_string().into_bytes())),
Expand Down Expand Up @@ -276,12 +276,12 @@ impl TakeRow for my::Row {
my::Value::Time(is_neg, days, hours, minutes, seconds, micros) => {
if is_neg {
let kind = ErrorKind::conversion("Failed to convert a negative time");
return Err(Error::builder(kind).build())
return Err(Error::builder(kind).build());
}

if days != 0 {
let kind = ErrorKind::conversion("Failed to read a MySQL `time` as duration");
return Err(Error::builder(kind).build())
return Err(Error::builder(kind).build());
}

let time = NaiveTime::from_hms_micro(hours.into(), minutes.into(), seconds.into(), micros);
Expand Down Expand Up @@ -310,7 +310,7 @@ impl TakeRow for my::Row {
);

let kind = ErrorKind::conversion(msg);
return Err(Error::builder(kind).build())
return Err(Error::builder(kind).build());
}
},
#[cfg(not(feature = "chrono-0_4"))]
Expand Down
2 changes: 1 addition & 1 deletion src/connector/postgres/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ fn string_to_bits(s: &str) -> crate::Result<BitVec> {
let msg = "Unexpected character for bits input. Expected only 1 and 0.";
let kind = ErrorKind::conversion(msg);

return Err(Error::builder(kind).build())
return Err(Error::builder(kind).build());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/connector/sqlite/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<'a> GetRow for SqliteRow<'a> {
let msg = format!("Value {} not supported", n);
let kind = ErrorKind::conversion(msg);

return Err(Error::builder(kind).build())
return Err(Error::builder(kind).build());
}
None => Value::Integer(None),
},
Expand Down Expand Up @@ -212,7 +212,7 @@ impl<'a> ToSql for Value<'a> {
let mut builder = Error::builder(kind);
builder.set_original_message(msg);

return Err(RusqlError::ToSqlConversionFailure(Box::new(builder.build())))
return Err(RusqlError::ToSqlConversionFailure(Box::new(builder.build())));
}
#[cfg(feature = "json-1")]
Value::Json(value) => value.as_ref().map(|value| {
Expand Down
2 changes: 1 addition & 1 deletion src/visitor/mssql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<'a> Visitor<'a> for Mssql<'a> {
let mut builder = Error::builder(kind);
builder.set_original_message(msg);

return Err(builder.build())
return Err(builder.build());
}
#[cfg(feature = "uuid-0_8")]
Value::Uuid(uuid) => uuid.map(|uuid| {
Expand Down
2 changes: 1 addition & 1 deletion src/visitor/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<'a> Visitor<'a> for Mysql<'a> {
let mut builder = Error::builder(kind);
builder.set_original_message(msg);

return Err(builder.build())
return Err(builder.build());
}
#[cfg(feature = "uuid-0_8")]
Value::Uuid(uuid) => uuid.map(|uuid| self.write(format!("'{}'", uuid.to_hyphenated().to_string()))),
Expand Down
2 changes: 1 addition & 1 deletion src/visitor/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl<'a> Visitor<'a> for Sqlite<'a> {
let mut builder = Error::builder(kind);
builder.set_original_message(msg);

return Err(builder.build())
return Err(builder.build());
}
#[cfg(feature = "uuid-0_8")]
Value::Uuid(uuid) => uuid.map(|uuid| self.write(format!("'{}'", uuid.to_hyphenated().to_string()))),
Expand Down