Skip to content

Commit 69d56ed

Browse files
committed
Fix linter warnings
1 parent d20ef0c commit 69d56ed

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

tusker-query/src/types.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ pub struct PgUuid;
3838
/// JSON, JSONB
3939
pub struct PgJson;
4040

41-
impl<'a> FromSqlTyped<'a, PgBool> for bool {}
42-
impl<'a> FromSqlTyped<'a, PgI8> for i8 {}
43-
impl<'a> FromSqlTyped<'a, PgI16> for i16 {}
44-
impl<'a> FromSqlTyped<'a, PgI32> for i32 {}
45-
impl<'a> FromSqlTyped<'a, PgI64> for i64 {}
46-
impl<'a> FromSqlTyped<'a, PgF32> for f32 {}
47-
impl<'a> FromSqlTyped<'a, PgF64> for f64 {}
41+
impl FromSqlTyped<'_, PgBool> for bool {}
42+
impl FromSqlTyped<'_, PgI8> for i8 {}
43+
impl FromSqlTyped<'_, PgI16> for i16 {}
44+
impl FromSqlTyped<'_, PgI32> for i32 {}
45+
impl FromSqlTyped<'_, PgI64> for i64 {}
46+
impl FromSqlTyped<'_, PgF32> for f32 {}
47+
impl FromSqlTyped<'_, PgF64> for f64 {}
4848
impl<'a> FromSqlTyped<'a, PgString> for &'a str {}
49-
impl<'a> FromSqlTyped<'a, PgString> for String {}
49+
impl FromSqlTyped<'_, PgString> for String {}
5050
impl<'a> FromSqlTyped<'a, PgBytea> for &'a [u8] {}
51-
impl<'a> FromSqlTyped<'a, PgBytea> for Vec<u8> {}
52-
impl<'a> FromSqlTyped<'a, PgHstore> for HashMap<String, Option<String>> {}
53-
impl<'a> FromSqlTyped<'a, PgTimestamp> for SystemTime {}
54-
impl<'a> FromSqlTyped<'a, PgTimestampTz> for SystemTime {}
55-
impl<'a> FromSqlTyped<'a, PgInet> for IpAddr {}
51+
impl FromSqlTyped<'_, PgBytea> for Vec<u8> {}
52+
impl FromSqlTyped<'_, PgHstore> for HashMap<String, Option<String>> {}
53+
impl FromSqlTyped<'_, PgTimestamp> for SystemTime {}
54+
impl FromSqlTyped<'_, PgTimestampTz> for SystemTime {}
55+
impl FromSqlTyped<'_, PgInet> for IpAddr {}
5656

5757
#[cfg(feature = "with-time-0_3")]
5858
impl<'a> FromSqlTyped<'a, PgTimestamp> for time_03::PrimitiveDateTime {}

tusker-schema/src/models/column.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub enum Identity {
8282
Default,
8383
}
8484

85-
impl<'a> DiffSql for Diff<'a, Column> {
85+
impl DiffSql for Diff<'_, Column> {
8686
fn sql(&self) -> Vec<(ChangeType, String)> {
8787
let mut v = Vec::new();
8888
for a in &self.a_only {

tusker-schema/src/models/constraint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<'a> FromSql<'a> for ConstraintType {
7171
}
7272
}
7373

74-
impl<'a> DiffSql for Diff<'a, Constraint> {
74+
impl DiffSql for Diff<'_, Constraint> {
7575
fn sql(&self) -> Vec<(ChangeType, String)> {
7676
let mut v = Vec::new();
7777
for a in &self.a_only {

tusker-schema/src/models/schema.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ impl Schema {
2121
..Default::default()
2222
}
2323
}
24-
pub fn diff_tables<'a>(&'a self, other: &'a Self) -> Diff<'_, Table> {
24+
pub fn diff_tables<'a>(&'a self, other: &'a Self) -> Diff<'a, Table> {
2525
diff(self.tables.values(), other.tables.values(), |table| {
2626
&table.name
2727
})
2828
}
29-
pub fn diff_constraints<'a>(&'a self, other: &'a Self) -> Diff<'_, Constraint> {
29+
pub fn diff_constraints<'a>(&'a self, other: &'a Self) -> Diff<'a, Constraint> {
3030
diff(self.constraints.values(), other.constraints.values(), |c| {
3131
(&c.table, &c.name)
3232
})
3333
}
3434
}
3535

36-
impl<'a> DiffSql for Diff<'a, Schema> {
36+
impl DiffSql for Diff<'_, Schema> {
3737
fn sql(&self) -> Vec<(ChangeType, String)> {
3838
let mut v = Vec::new();
3939
if !self.a_only.is_empty() {

tusker-schema/src/models/table.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl Table {
6464
}
6565
}
6666

67-
impl<'a> DiffSql for Diff<'a, Table> {
67+
impl DiffSql for Diff<'_, Table> {
6868
fn sql(&self) -> Vec<(ChangeType, String)> {
6969
let mut v = Vec::new();
7070
for a in &self.a_only {

tusker-schema/src/sql.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::fmt;
2+
13
#[derive(Debug, Default)]
24
pub struct StatementBuilder {
35
parts: Vec<String>,
@@ -15,9 +17,9 @@ impl StatementBuilder {
1517
}
1618
}
1719

18-
impl ToString for StatementBuilder {
19-
fn to_string(&self) -> String {
20-
self.parts.join(" ")
20+
impl fmt::Display for StatementBuilder {
21+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22+
write!(f, "{}", self.parts.join(" "))
2123
}
2224
}
2325

0 commit comments

Comments
 (0)