Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Nov 21, 2023
1 parent 37a30f6 commit cb5bf91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions src/backend/postgres/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,11 @@ impl QueryBuilder for PostgresQueryBuilder {
}

fn write_bytes(&self, bytes: &[u8], buffer: &mut String) {
write!(
buffer,
"'\\x{}'",
bytes.iter().map(|b| format!("{b:02X}")).collect::<String>()
)
.unwrap()
write!(buffer, "'\\x").unwrap();
for b in bytes {
format!("{b:02X}");
}
write!(buffer, "'").unwrap();
}

fn if_null_function(&self) -> &str {
Expand Down
11 changes: 5 additions & 6 deletions src/backend/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,12 +1405,11 @@ pub trait QueryBuilder:
#[doc(hidden)]
/// Write bytes enclosed with engine specific byte syntax
fn write_bytes(&self, bytes: &[u8], buffer: &mut String) {
write!(
buffer,
"x'{}'",
bytes.iter().map(|b| format!("{b:02X}")).collect::<String>()
)
.unwrap()
write!(buffer, "x'").unwrap();
for b in bytes {
format!("{b:02X}");
}
write!(buffer, "'").unwrap();
}

#[doc(hidden)]
Expand Down

0 comments on commit cb5bf91

Please sign in to comment.