Also run clippy on examples (#666)

* Also run clippy on examples

This PR also fixes existing clippy lints

* Update .github/workflows/ci.yml

---------

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
Hofer-Julian 2023-11-14 11:40:28 +01:00 committed by GitHub
parent d9e0a326df
commit 63c43a9a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ jobs:
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy ${{ matrix.flags }} --all -- -D warnings
run: cargo clippy ${{ matrix.flags }} --all-targets --all -- -D warnings
- name: Tests

View File

@ -52,8 +52,8 @@ fn main() -> io::Result<()> {
let home_dir = std::env::home_dir().unwrap();
let history = create_filled_example_history(
&home_dir.to_string_lossy().to_string(),
&orig_dir.to_string_lossy().to_string(),
home_dir.to_string_lossy().as_ref(),
orig_dir.to_string_lossy().as_ref(),
);
let mut line_editor = Reedline::create()

View File

@ -61,7 +61,7 @@ struct CustomValidator;
impl Validator for CustomValidator {
fn validate(&self, line: &str) -> ValidationResult {
if line.ends_with("\\") {
if line.ends_with('\\') {
ValidationResult::Incomplete
} else {
ValidationResult::Complete