Skip to content

Commit

Permalink
Clean-up CI config (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jun 17, 2022
1 parent fcaeb0e commit 9c1977b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/main.yml
Expand Up @@ -21,7 +21,10 @@ jobs:
- 1.56.0 # MSRV
- stable
- nightly
os: [ubuntu-latest, macos-latest, windows-latest]
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -35,19 +38,27 @@ jobs:
rustup override set ${{ matrix.version }}
- name: check build
if: matrix.version != 'stable' && matrix.os == 'macos-latest'
if: matrix.version != '1.56.0' && matrix.os == 'macos-latest'
run: cargo check --features=serde,macos_kqueue --examples

- name: check build
if: matrix.version != 'stable' && matrix.os != 'macos-latest'
if: matrix.version == '1.56.0' && matrix.os == 'macos-latest'
run: cargo check --features=serde,macos_kqueue

- name: check build
if: matrix.version != '1.56.0' && matrix.os != 'macos-latest'
run: cargo check --features=serde --examples

- name: check build
if: matrix.version == '1.56.0' && matrix.os != 'macos-latest'
run: cargo check --features=serde

- name: check build example
if: matrix.version != 'stable'
if: matrix.version == 'stable'
run: cargo check -p watcher_kind

- name: test hot_reload_tide
if: matrix.version != 'stable'
if: matrix.version == 'stable'
run: cargo test -p hot_reload_tide

- name: test
Expand All @@ -61,7 +72,6 @@ jobs:
target:
- x86_64-unknown-netbsd
- x86_64-unknown-freebsd
- x86_64-apple-darwin
runs-on: ubuntu-latest

steps:
Expand All @@ -72,12 +82,12 @@ jobs:
run: |
rustup set profile minimal
rustup toolchain install stable --no-self-update
rustup target add ${{ matrix.target}}
rustup target add ${{ matrix.target }}
- name: check build
run: |
rustc --version && cargo --version
cargo build --target ${{ matrix.target}}
rustc --version && cargo --version
cargo build --target ${{ matrix.target }}
audit:
runs-on: ubuntu-latest
Expand Down
16 changes: 9 additions & 7 deletions src/poll.rs
Expand Up @@ -53,7 +53,7 @@ mod data {
{
Self {
emitter: EventEmitter::new(event_handler),
build_hasher: compare_content.then(|| RandomState::default()),
build_hasher: compare_content.then(RandomState::default),
now: Instant::now(),
}
}
Expand Down Expand Up @@ -187,11 +187,11 @@ mod data {
/// # Side Effect
///
/// This function may emit some IO Error events by `data_builder.emitter`.
fn scan_all_path_data<'a>(
data_builder: &'a DataBuilder,
fn scan_all_path_data(
data_builder: &'_ DataBuilder,
root: PathBuf,
is_recursive: bool,
) -> impl Iterator<Item = (PathBuf, PathData)> + 'a {
) -> impl Iterator<Item = (PathBuf, PathData)> + '_ {
// WalkDir return only one entry if root is a file (not a folder),
// so we can use single logic to do the both file & dir's jobs.
//
Expand Down Expand Up @@ -263,7 +263,7 @@ mod data {
let metadata = meta_path.metadata();

PathData {
mtime: FileTime::from_last_modification_time(&metadata).seconds(),
mtime: FileTime::from_last_modification_time(metadata).seconds(),
hash: data_builder
.build_hasher
.as_ref()
Expand Down Expand Up @@ -470,7 +470,9 @@ impl PollWatcher {
{
data_builder.update_timestamp();

for watch_data in watches.values_mut() {

let vals = watches.values_mut();
for watch_data in vals {
watch_data.rescan(&mut data_builder);
}
}
Expand Down Expand Up @@ -523,7 +525,7 @@ impl PollWatcher {
.unwrap()
.remove(path)
.map(|_| ())
.ok_or_else(|| crate::Error::watch_not_found())
.ok_or_else(crate::Error::watch_not_found)
}
}

Expand Down

0 comments on commit 9c1977b

Please sign in to comment.