Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Make clippy happy #114

Merged
merged 2 commits into from Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: No-default features
run: cargo test --workspace --no-default-features
msrv:
name: "Check MSRV: 1.40.0"
name: "Check MSRV: 1.54.0"
needs: smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -76,7 +76,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.40.0 # MSRV
toolchain: 1.54.0 # MSRV
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.40.0 # MSRV
toolchain: 1.54.0 # MSRV
profile: minimal
override: true
components: clippy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-next.yml
Expand Up @@ -57,9 +57,9 @@ jobs:
strategy:
matrix:
rust:
- 1.44.0 # MSRV
- 1.54.0 # MSRV
- stable
continue-on-error: ${{ matrix.rust != '1.44.0' }} # MSRV
continue-on-error: ${{ matrix.rust != '1.54.0' }} # MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion crates/tree/examples/failures.rs
Expand Up @@ -12,7 +12,7 @@ fn main() {

let expected = [1, 2, 3];
let actual = 15;
let pred = predicates::iter::in_iter(expected);
let pred = predicates::iter::in_iter(IntoIterator::into_iter(expected));
if let Some(case) = pred.find_case(false, &actual) {
let tree = case.tree();
println!("{}", tree);
Expand Down
7 changes: 3 additions & 4 deletions src/str/normalize.rs
Expand Up @@ -11,7 +11,6 @@ use crate::Predicate;
use std::fmt;

use normalize_line_endings::normalized;
use std::iter::FromIterator;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
/// Predicate adapter that normalizes the newlines contained in the variable being tested.
Expand Down Expand Up @@ -39,12 +38,12 @@ where
P: Predicate<str>,
{
fn eval(&self, variable: &str) -> bool {
self.p
.eval(&String::from_iter(normalized(variable.chars())))
let variable = normalized(variable.chars()).collect::<String>();
self.p.eval(&variable)
}

fn find_case<'a>(&'a self, expected: bool, variable: &str) -> Option<reflection::Case<'a>> {
let variable = String::from_iter(normalized(variable.chars()));
let variable = normalized(variable.chars()).collect::<String>();
self.p.find_case(expected, &variable)
}
}
Expand Down