Skip to content

Commit

Permalink
fix: ci error
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Aug 13, 2024
1 parent f249ad9 commit 6c961a1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 87 deletions.
84 changes: 5 additions & 79 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion crates/rspack_glob/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ name = "rspack_glob"
repository = "https://github.com/web-infra-dev/rspack"
version = "0.1.0"

[package.metadata.cargo-shear]
ignored = ["tempdir"]

[dev-dependencies]
codspeed-criterion-compat = "2.6.0"
criterion = "0.4.0"
fast-glob = "0.3.2"
tempdir = "0.3"

Expand Down
5 changes: 3 additions & 2 deletions crates/rspack_glob/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion};

const PATH: &'static str = "some/a/bigger/path/to/the/crazy/needle.txt";
const GLOB: &'static str = "some/**/needle.txt";
const PATH: &str = "some/a/bigger/path/to/the/crazy/needle.txt";
const GLOB: &str = "some/**/needle.txt";

#[inline]
fn rspack_glob(pat: &str, s: &str) -> bool {
#[allow(clippy::unwrap_used)]
let pat = rspack_glob::Pattern::new(pat).unwrap();
pat.matches(s)
}
Expand Down
6 changes: 2 additions & 4 deletions crates/rspack_glob/tests/glob-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

// ignore-windows TempDir may cause IoError on windows: #10462

#![cfg_attr(test, deny(warnings))]

extern crate tempdir;

use std::env;
Expand Down Expand Up @@ -69,7 +67,7 @@ fn main() {
}

let root = TempDir::new("glob-tests");
let root = root.ok().expect("Should have created a temp directory");
let root = root.expect("Should have created a temp directory");
assert!(env::set_current_dir(root.path()).is_ok());

mk_file("aaa", true);
Expand Down Expand Up @@ -148,7 +146,7 @@ fn main() {
if env::consts::FAMILY == "windows" {
let r_verbatim = PathBuf::from("r").canonicalize().unwrap();
assert_eq!(
glob_vec(&format!("{}\\**", r_verbatim.display().to_string()))
glob_vec(&format!("{}\\**", r_verbatim.display()))
.into_iter()
.map(|p| p.strip_prefix(&r_verbatim).unwrap().to_owned())
.collect::<Vec<_>>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn glob_match_with_normalized_pattern(
let pat = entry.insert(pat);
pat.matches(string.trim_start_matches("./"))
}
Err(_) => return false,
Err(_) => false,
}
}
}
Expand Down

0 comments on commit 6c961a1

Please sign in to comment.