Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kyclark committed Aug 12, 2021
1 parent 39351de commit 9f516ae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 11_fortuner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn read_fortunes(
let mut buffer = vec![];

let is_match =
|text: &str| pattern.as_ref().map_or(true, |re| re.is_match(&text));
|text: &str| pattern.as_ref().map_or(true, |re| re.is_match(text));

for path in paths {
let source = path.file_name().unwrap().to_string_lossy().into_owned();
Expand Down
2 changes: 1 addition & 1 deletion 12_calr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn get_args() -> MyResult<Config> {

Ok(Config {
month,
year: year.unwrap_or(today.year()),
year: year.unwrap_or_else(|| today.year()),
})
}

Expand Down
2 changes: 1 addition & 1 deletion 13_lsr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn find_files(paths: &[String], show_hidden: bool) -> MyResult<Vec<PathBuf>> {
let path = entry.path();
let is_hidden =
path.file_name().map_or(false, |name| {
name.to_string_lossy().starts_with(".")
name.to_string_lossy().starts_with('.')
});
if !is_hidden || show_hidden {
results.push(PathBuf::from(entry.path()));
Expand Down
4 changes: 1 addition & 3 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env bash

DIRS=$(find . -mindepth 1 -maxdepth 1 -type d -name [01][0-9]_\* | sort)
for DIR in $DIRS; do
for DIR in [01]*; do
DIRNAME=$(basename "$DIR")
echo "==> $DIRNAME <=="
(cd $DIR && cargo test -q > /dev/null && cargo clippy)
[[ $DIRNAME == "10_tailr" ]] && break
done

echo "Done."

0 comments on commit 9f516ae

Please sign in to comment.