Skip to content

Commit

Permalink
style: Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 7, 2021
1 parent 12c7ec8 commit f25228a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit f25228a

Please sign in to comment.