Skip to content

Commit bf87bb4

Browse files
committed
Merge branch 'clippy_fixes' into basic_tls_support_2
2 parents 58741fe + 4663d94 commit bf87bb4

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

examples/psql_as_mysql.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<W: io::Read + io::Write> MysqlShim<W> for Postgres {
139139
use std::mem;
140140
let params: Vec<_> = stmt
141141
.params()
142-
.into_iter()
142+
.iter()
143143
.map(|t| {
144144
let ct = p2mt(t);
145145
Column {
@@ -152,7 +152,7 @@ impl<W: io::Read + io::Write> MysqlShim<W> for Postgres {
152152
.collect();
153153
let columns: Vec<_> = stmt
154154
.columns()
155-
.into_iter()
155+
.iter()
156156
.map(|c| {
157157
let t = c.type_();
158158
let ct = p2mt(t);
@@ -268,10 +268,10 @@ fn answer_rows<W: io::Read + io::Write>(
268268
) -> Result<(), Error> {
269269
match rows {
270270
Ok(rows) => {
271-
if let Some(first) = rows.iter().next() {
271+
if let Some(first) = rows.get(0) {
272272
let cols: Vec<_> = first
273273
.columns()
274-
.into_iter()
274+
.iter()
275275
.map(|c| {
276276
let t = c.type_();
277277
let ct = p2mt(t);

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ impl<B: MysqlShim<RW>, RW: Read + Write> MysqlIntermediary<B, RW> {
378378
let schema = ::std::str::from_utf8(&q[b"USE ".len()..])
379379
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
380380
let schema = schema.trim().trim_end_matches(';').trim_matches('`');
381-
self.shim.on_init(&schema, w)?;
381+
self.shim.on_init(schema, w)?;
382382
} else {
383383
let w = QueryResultWriter::new(&mut self.rw, false);
384384
self.shim.on_query(

src/value/decode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ use std::time::Duration;
251251
impl<'a> Into<Duration> for Value<'a> {
252252
fn into(self) -> Duration {
253253
if let ValueInner::Time(mut v) = self.0 {
254-
assert!(v.len() == 0 || v.len() == 8 || v.len() == 12);
254+
assert!(v.is_empty() || v.len() == 8 || v.len() == 12);
255255

256-
if v.len() == 0 {
256+
if v.is_empty() {
257257
return Duration::from_secs(0);
258258
}
259259

tests/async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ where
103103
});
104104

105105
tokio::runtime::current_thread::block_on_all(
106-
mysql_async::Conn::new(format!("mysql://127.0.0.1:{}", port)).and_then(|conn| c(conn)),
106+
mysql_async::Conn::new(format!("mysql://127.0.0.1:{}", port)).and_then(c),
107107
)
108108
.unwrap();
109109

@@ -664,7 +664,7 @@ fn prepared_empty() {
664664
coltype: myc::constants::ColumnType::MYSQL_TYPE_SHORT,
665665
colflags: myc::constants::ColumnFlags::empty(),
666666
}];
667-
let cols2 = cols.clone();
667+
let cols2 = cols;
668668
let params = vec![Column {
669669
table: String::new(),
670670
column: "c".to_owned(),

tests/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ where
136136

137137
fn test<C>(self, c: C)
138138
where
139-
C: FnOnce(&mut mysql::Conn) -> (),
139+
C: FnOnce(&mut mysql::Conn),
140140
{
141141
self.test_with_result(c).unwrap()
142142
}
@@ -854,7 +854,7 @@ fn prepared_empty() {
854854
coltype: myc::constants::ColumnType::MYSQL_TYPE_SHORT,
855855
colflags: myc::constants::ColumnFlags::empty(),
856856
}];
857-
let cols2 = cols.clone();
857+
let cols2 = cols;
858858
let params = vec![Column {
859859
table: String::new(),
860860
column: "c".to_owned(),

0 commit comments

Comments
 (0)