Skip to content

Commit 6b22e74

Browse files
committed
bump fmt and clippy
1 parent 09ecfba commit 6b22e74

File tree

34 files changed

+131
-111
lines changed

34 files changed

+131
-111
lines changed

.rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hard_tabs = true
22
imports_layout = "Horizontal"
3-
merge_imports = true
3+
imports_granularity = "Crate"
44
fn_args_layout = "Compressed"
55
use_field_init_shorthand = true
66

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
176176
"us-east-1.data-analytics",
177177
"cflogworkshop/optimized/cf-accesslogs/",
178178
AwsCredentials::Anonymous,
179-
)))
179+
)), None)
180180
.await?;
181181
182182
// Note: this isn't yet implemented!
@@ -222,7 +222,7 @@ fn main() -> Result<(), Box<dyn Error>> {
222222
"us-east-1.data-analytics",
223223
"cflogworkshop/optimized/cf-accesslogs/",
224224
AwsCredentials::Anonymous,
225-
)))
225+
)), None)
226226
.await?;
227227

228228
let top_pages = rows

amadeus-aws/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! This is a support crate of [Amadeus](https://github.com/constellation-rs/amadeus) and is not intended to be used directly. These types are re-exposed in [`amadeus::source`](https://docs.rs/amadeus/0.3/amadeus/source/index.html).
88
99
#![doc(html_root_url = "https://docs.rs/amadeus-aws/0.4.2")]
10-
#![cfg_attr(nightly, feature(type_alias_impl_trait))]
10+
#![cfg_attr(nightly, feature(min_type_alias_impl_trait))]
1111
#![warn(
1212
// missing_copy_implementations,
1313
// missing_debug_implementations,
@@ -25,8 +25,9 @@
2525
clippy::too_many_lines,
2626
clippy::must_use_candidate,
2727
clippy::type_repetition_in_bounds,
28-
clippy::filter_map,
29-
clippy::missing_errors_doc
28+
clippy::missing_errors_doc,
29+
clippy::missing_panics_doc,
30+
clippy::let_underscore_drop
3031
)]
3132
#![deny(unsafe_code)]
3233

amadeus-commoncrawl/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! This is a support crate of [Amadeus](https://github.com/constellation-rs/amadeus) and is not intended to be used directly. These types are re-exposed in [`amadeus::source`](https://docs.rs/amadeus/0.3/amadeus/source/index.html).
88
99
#![doc(html_root_url = "https://docs.rs/amadeus-commoncrawl/0.4.2")]
10-
#![cfg_attr(nightly, feature(type_alias_impl_trait))]
10+
#![cfg_attr(nightly, feature(min_type_alias_impl_trait))]
1111
#![warn(
1212
// missing_copy_implementations,
1313
// missing_debug_implementations,
@@ -22,7 +22,9 @@
2222
#![allow(
2323
clippy::doc_markdown,
2424
clippy::inline_always,
25-
clippy::missing_errors_doc
25+
clippy::missing_errors_doc,
26+
clippy::missing_panics_doc,
27+
clippy::let_underscore_drop
2628
)]
2729
#![deny(unsafe_code)]
2830

amadeus-commoncrawl/src/parser.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ impl<'a> fmt::Debug for Record<'a> {
5353
// write!(form, "\n").unwrap();
5454
// }
5555
writeln!(form, "Content Length:{}", self.content.len()).unwrap();
56-
let s = match str::from_utf8(self.content) {
57-
Ok(s) => s,
58-
Err(_) => "Could not convert",
59-
};
56+
let s = str::from_utf8(self.content).unwrap_or("Could not convert");
6057
writeln!(form, "Content :{:?}", s).unwrap();
6158
writeln!(form)
6259
}

amadeus-core/src/file.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl OsString {
3131
pub fn to_string_lossy(&self) -> String {
3232
self.buf.to_string_lossy()
3333
}
34-
pub fn display<'a>(&'a self) -> impl fmt::Display + 'a {
34+
pub fn display(&self) -> impl fmt::Display + '_ {
3535
struct Display<'a>(&'a OsString);
3636
impl<'a> fmt::Display for Display<'a> {
3737
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -160,15 +160,14 @@ impl PathBuf {
160160
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &OsString> + 'a {
161161
self.components.iter()
162162
}
163-
pub fn display<'a>(&'a self) -> impl fmt::Display + 'a {
163+
pub fn display(&self) -> impl fmt::Display + '_ {
164164
struct Display<'a>(&'a PathBuf);
165165
impl<'a> fmt::Display for Display<'a> {
166166
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
167167
let mut res: fmt::Result = self
168168
.0
169169
.iter()
170-
.map(|component| write!(f, "{}/", component.to_string_lossy()))
171-
.collect();
170+
.try_for_each(|component| write!(f, "{}/", component.to_string_lossy()));
172171
if let Some(file_name) = self.0.file_name() {
173172
res = res.and_then(|()| write!(f, "{}", file_name.to_string_lossy()));
174173
}
@@ -315,7 +314,7 @@ where
315314
buf_.len()
316315
})
317316
.map_err(Into::into);
318-
*self_.offset += u64::try_from(ret.as_ref().ok().cloned().unwrap_or(0)).unwrap();
317+
*self_.offset += u64::try_from(ret.as_ref().ok().copied().unwrap_or(0)).unwrap();
319318
Poll::Ready(ret)
320319
}
321320
}

amadeus-core/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
clippy::inline_always,
3232
clippy::option_option,
3333
clippy::default_trait_access,
34-
clippy::filter_map,
3534
clippy::wildcard_imports,
36-
clippy::needless_pass_by_value
35+
clippy::needless_pass_by_value,
36+
clippy::unnecessary_wraps,
37+
clippy::missing_panics_doc,
38+
clippy::let_underscore_drop
3739
)]
3840
#![deny(unsafe_code)]
3941

amadeus-core/src/par_sink/combiner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
#![allow(unused_imports, clippy::single_component_path_imports, clippy::option_if_let_else)]
1+
#![allow(
2+
unused_imports,
3+
clippy::single_component_path_imports,
4+
clippy::option_if_let_else
5+
)]
26

37
use super::FolderSync;
48

amadeus-core/src/par_sink/folder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused_imports,clippy::single_component_path_imports)]
1+
#![allow(unused_imports, clippy::single_component_path_imports)]
22

33
use derive_new::new;
44
use educe::Educe;

amadeus-core/src/par_sink/tuple.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
#![allow(non_snake_case, clippy::type_complexity, irrefutable_let_patterns, clippy::new_without_default, unused_mut, unreachable_code, clippy::too_many_arguments)]
1+
#![allow(
2+
non_snake_case,
3+
clippy::type_complexity,
4+
irrefutable_let_patterns,
5+
clippy::new_without_default,
6+
unused_mut,
7+
unreachable_code,
8+
clippy::too_many_arguments
9+
)]
210

311
use derive_new::new;
412
use futures::{pin_mut, ready, stream, Stream, StreamExt};
@@ -100,6 +108,7 @@ macro_rules! impl_tuple {
100108
type Output = $enum<$($i::Output,)*>;
101109
type Task = ($($i::Task,)*);
102110

111+
#[allow(clippy::unused_unit)]
103112
fn task(&self) -> Self::Task {
104113
($(self.$num.task(),)*)
105114
}
@@ -111,6 +120,7 @@ macro_rules! impl_tuple {
111120
type Output = $enum<$($i::Output,)*>;
112121
type Task = ($($i::Task,)*);
113122

123+
#[allow(clippy::unused_unit)]
114124
fn task(&self) -> Self::Task {
115125
($(self.$num.task(),)*)
116126
}

0 commit comments

Comments
 (0)