Skip to content

Commit

Permalink
Use clippy 1.72 in CI and fix lints (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
msrd0 authored Sep 12, 2023
1 parent 5a92811 commit c433082
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
id: rust-toolchain
with:
toolchain: "1.69"
toolchain: "1.72"
components: clippy

- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion examples/path/globs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn multi_parts_handler(state: State) -> (State, String) {
bottom.push_str(part);
}

vec![top, bottom].join("\n\n")
[top, bottom].join("\n\n")
};

(state, res)
Expand Down
2 changes: 1 addition & 1 deletion gotham/src/middleware/session/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rand_chacha::ChaChaCore;
pub(super) type SessionIdentifierRng = ReseedingRng<ChaChaCore, OsRng>;

pub(super) fn session_identifier_rng() -> SessionIdentifierRng {
let os_rng = OsRng::default();
let os_rng = OsRng;
let rng = ChaChaCore::from_entropy();

// Reseed every 32KiB.
Expand Down
2 changes: 1 addition & 1 deletion gotham/src/router/non_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl From<MethodSet> for Vec<Method> {
let mut result = methods_with_flags
.iter()
.filter_map(|&(ref method, flag)| if flag { Some(method.clone()) } else { None })
.chain(method_set.other.into_iter())
.chain(method_set.other)
.collect::<Vec<Method>>();

result.sort_unstable_by(|a, b| a.as_ref().cmp(b.as_ref()));
Expand Down
1 change: 1 addition & 0 deletions gotham/src/service/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ mod tests {

#[test]
fn panic() {
#[allow(clippy::unnecessary_literal_unwrap)] // false positive? or bad description?
let new_handler = || {
Ok(|_| {
let val: Option<Pin<Box<HandlerFuture>>> = None;
Expand Down
2 changes: 1 addition & 1 deletion misc/borrow_bag/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn new_handle<T, N>() -> Handle<T, N> {

impl<T, N> Clone for Handle<T, N> {
fn clone(&self) -> Handle<T, N> {
new_handle()
*self
}
}

Expand Down

0 comments on commit c433082

Please sign in to comment.