Skip to content

Commit 441f0c6

Browse files
committed
lint: apply clippy suggestions
1 parent 58dc679 commit 441f0c6

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

datafusion/execution/src/runtime_env.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::{
2727
};
2828

2929
use crate::cache::cache_manager::{CacheManager, CacheManagerConfig};
30-
use datafusion_common::{DataFusionError, Result};
30+
use datafusion_common::Result;
3131
use object_store::ObjectStore;
3232
use std::path::PathBuf;
3333
use std::sync::Arc;
@@ -139,9 +139,7 @@ impl RuntimeEnv {
139139
/// registry. See [`ObjectStoreRegistry::get_store`] for more
140140
/// details.
141141
pub fn object_store(&self, url: impl AsRef<Url>) -> Result<Arc<dyn ObjectStore>> {
142-
self.object_store_registry
143-
.get_store(url.as_ref())
144-
.map_err(DataFusionError::from)
142+
self.object_store_registry.get_store(url.as_ref())
145143
}
146144
}
147145

datafusion/physical-expr-common/src/binary_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ where
383383

384384
// value is "small"
385385
let payload = if value.len() <= SHORT_VALUE_LEN {
386-
let inline = value.iter().fold(0usize, |acc, &x| acc << 8 | x as usize);
386+
let inline = value.iter().fold(0usize, |acc, &x| (acc << 8) | x as usize);
387387

388388
// is value is already present in the set?
389389
let entry = self.map.get_mut(hash, |header| {

datafusion/sql/src/expr/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ fn try_decode_hex_literal(s: &str) -> Option<Vec<u8>> {
389389
for i in (start_idx..hex_bytes.len()).step_by(2) {
390390
let high = try_decode_hex_char(hex_bytes[i])?;
391391
let low = try_decode_hex_char(hex_bytes[i + 1])?;
392-
decoded_bytes.push(high << 4 | low);
392+
decoded_bytes.push((high << 4) | low);
393393
}
394394

395395
Some(decoded_bytes)

test-utils/src/string_gen.rs

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ fn random_string(rng: &mut StdRng, max_len: usize) -> String {
132132
let len = rng.gen_range(1..=max_len);
133133
rng.sample_iter::<char, _>(rand::distributions::Standard)
134134
.take(len)
135-
.map(char::from)
136135
.collect::<String>()
137136
}
138137
}

0 commit comments

Comments
 (0)