Skip to content

Commit

Permalink
Minor clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
psvri committed Jan 5, 2025
1 parent 24a6bff commit 937f398
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
14 changes: 4 additions & 10 deletions arrow-cast/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,18 +881,15 @@ pub fn parse_decimal<T: DecimalType>(
for (_, b) in bs.by_ref() {
if !b.is_ascii_digit() {
if *b == b'e' || *b == b'E' {
result = match parse_e_notation::<T>(
result = parse_e_notation::<T>(
s,
digits as u16,
fractionals as i16,
result,
point_index,
precision as u16,
scale as i16,
) {
Err(e) => return Err(e),
Ok(v) => v,
};
)?;

is_e_notation = true;

Expand Down Expand Up @@ -926,18 +923,15 @@ pub fn parse_decimal<T: DecimalType>(
}
}
b'e' | b'E' => {
result = match parse_e_notation::<T>(
result = parse_e_notation::<T>(
s,
digits as u16,
fractionals as i16,
result,
index,
precision as u16,
scale as i16,
) {
Err(e) => return Err(e),
Ok(v) => v,
};
)?;

is_e_notation = true;

Expand Down
2 changes: 1 addition & 1 deletion arrow-flight/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ mod tests {
.flight_descriptor
.as_ref()
.map(|descriptor| {
let path_len: usize = descriptor.path.iter().map(|p| p.as_bytes().len()).sum();
let path_len: usize = descriptor.path.iter().map(|p| p.len()).sum();

std::mem::size_of_val(descriptor) + descriptor.cmd.len() + path_len
})
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ pub(crate) struct Request<'a> {
retry_error_body: bool,
}

impl<'a> Request<'a> {
impl Request<'_> {
pub(crate) fn query<T: Serialize + ?Sized + Sync>(self, query: &T) -> Self {
let builder = self.builder.query(query);
Self { builder, ..self }
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/azure/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct PutRequest<'a> {
idempotent: bool,
}

impl<'a> PutRequest<'a> {
impl PutRequest<'_> {
fn header(self, k: &HeaderName, v: &str) -> Self {
let builder = self.builder.header(k, v);
Self { builder, ..self }
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/gcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub(crate) struct Request<'a> {
idempotent: bool,
}

impl<'a> Request<'a> {
impl Request<'_> {
fn header(self, k: &HeaderName, v: &str) -> Self {
let builder = self.builder.header(k, v);
Self { builder, ..self }
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ struct InMemoryRowGroup<'a> {
row_count: usize,
}

impl<'a> InMemoryRowGroup<'a> {
impl InMemoryRowGroup<'_> {
/// Fetches the necessary column data into memory
async fn fetch<T: AsyncFileReader + Send>(
&mut self,
Expand Down
4 changes: 2 additions & 2 deletions parquet/src/column/writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3275,8 +3275,8 @@ mod tests {
fn test_truncate_utf8() {
// No-op
let data = "❤️🧡💛💚💙💜";
let r = truncate_utf8(data, data.as_bytes().len()).unwrap();
assert_eq!(r.len(), data.as_bytes().len());
let r = truncate_utf8(data, data.len()).unwrap();
assert_eq!(r.len(), data.len());
assert_eq!(&r, data.as_bytes());

// We slice it away from the UTF8 boundary
Expand Down

0 comments on commit 937f398

Please sign in to comment.