Skip to content

Commit

Permalink
Apply RustFmt and Clippy recommended changes
Browse files Browse the repository at this point in the history
In order to make the CI work, we need to comply with RustFmt and Clippy
rules.
  • Loading branch information
luismiramirez committed Sep 17, 2021
1 parent a68b071 commit cf6f322
Show file tree
Hide file tree
Showing 6 changed files with 530 additions and 373 deletions.
5 changes: 0 additions & 5 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ blocks:
jobs:
- name: Formatter and linter
commands:
- checkout
- rustup component add rustfmt clippy
- cache restore clippy-${SEMAPHORE_GIT_BRANCH}-${LOCK_CHECKSUM}
- cargo fmt --verbose --all -- --check
- cargo clippy
- cache store clippy-${SEMAPHORE_GIT_BRANCH}-${LOCK_CHECKSUM}
- name: Build and tests
commands:
- checkout
- rustup toolchain install nightly
- cargo build --verbose
- cargo +nightly test --verbose
8 changes: 4 additions & 4 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
extern crate sql_lexer;

use std::env;
use std::io::prelude::*;
use std::fs::File;
use std::io::prelude::*;

use sql_lexer::*;

fn main() {
match env::args().skip(1).next() {
match env::args().nth(1) {
Some(arg) => {
let mut file = File::open(arg.as_str()).unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
println!("{}", sanitize_string(contents));
},
None => println!("Please supply a path to a file containing SQL")
}
None => println!("Please supply a path to a file containing SQL"),
}
}

0 comments on commit cf6f322

Please sign in to comment.