Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Aug 6, 2021
1 parent 15c81ee commit aa7f71a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion odbc-api/src/buffers/bin_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl BinColumn {
BinColumnIt {
pos: 0,
num_rows,
col: &self,
col: self,
}
}

Expand Down
2 changes: 1 addition & 1 deletion odbc-api/src/buffers/text_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl<C> TextColumn<C> {
TextColumnIt {
pos: 0,
num_rows,
col: &self,
col: self,
}
}

Expand Down
4 changes: 2 additions & 2 deletions odbc-api/src/parameter/varbin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ where
let slice = self.buffer.borrow();
match self.indicator() {
Indicator::Null => None,
Indicator::NoTotal => Some(&slice),
Indicator::NoTotal => Some(slice),
Indicator::Length(len) => {
if self.is_complete() {
Some(&slice[..len])
} else {
Some(&slice)
Some(slice)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion odbc-api/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn setup_empty_table(
.join(", ");

let create_table = format!("CREATE TABLE {} (id {},{});", table_name, index_type, cols);
conn.execute(&drop_table, ())?;
conn.execute(drop_table, ())?;
conn.execute(&create_table, ())?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion odbc-api/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ fn large_strings(profile: &Profile) {

loop {
row.get_data(1, &mut buf).unwrap();
actual += &std::str::from_utf8(buf.as_bytes().unwrap()).unwrap();
actual += std::str::from_utf8(buf.as_bytes().unwrap()).unwrap();
if buf.is_complete() {
break;
}
Expand Down
6 changes: 3 additions & 3 deletions odbcsv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ fn query(environment: &Environment, opt: &QueryOpt) -> Result<(), Error> {
};
let mut writer = csv::Writer::from_writer(out);

let connection = open_connection(&environment, connect_opts)?;
let connection = open_connection(environment, connect_opts)?;

// Convert the input strings into parameters suitable to for use with ODBC.
let params: Vec<_> = parameters
Expand All @@ -254,7 +254,7 @@ fn query(environment: &Environment, opt: &QueryOpt) -> Result<(), Error> {
.collect();

// Execute the query as a one off, and pass the parameters.
match connection.execute(&query, params.as_slice())? {
match connection.execute(query, params.as_slice())? {
Some(cursor) => {
// Write column names.
let headline: Vec<String> = cursor.column_names()?.collect::<Result<_, _>>()?;
Expand Down Expand Up @@ -304,7 +304,7 @@ fn insert(environment: &Environment, insert_opt: &InsertOpt) -> Result<(), Error
Box::new(hold_stdin.lock())
};
let mut reader = csv::Reader::from_reader(input);
let connection = open_connection(&environment, connect_opts)?;
let connection = open_connection(environment, connect_opts)?;

// Generate statement text from table name and headline
let headline = reader.byte_headers()?;
Expand Down

0 comments on commit aa7f71a

Please sign in to comment.