Skip to content

Commit

Permalink
refactor(semantic): remove more-asserts dependency (#5739)
Browse files Browse the repository at this point in the history
Remove `more-asserts` dependency which was added in #5710.

As suggested by @Boshen in #5710 (review).
  • Loading branch information
overlookmotel committed Sep 13, 2024
1 parent 333e2e0 commit 7dfcdfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ memoffset = "0.9.1"
miette = { version = "7.2.0", features = ["fancy-no-syscall"] }
mimalloc = "0.1.43"
mime_guess = "2.0.5"
more-asserts = "0.3.1"
nonmax = "0.5.5"
num-bigint = "0.4.6"
num-traits = "0.2.19"
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_semantic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ oxc_syntax = { workspace = true }
assert-unchecked = { workspace = true }
indexmap = { workspace = true }
itertools = { workspace = true }
more-asserts = { workspace = true }
phf = { workspace = true, features = ["macros"] }
rustc-hash = { workspace = true }
serde = { workspace = true, features = ["derive"], optional = true }
Expand Down
9 changes: 6 additions & 3 deletions crates/oxc_semantic/src/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use std::cell::Cell;

use more_asserts::assert_le;

use oxc_ast::{
ast::{
BindingIdentifier, IdentifierReference, Program, TSEnumMemberName, TSModuleDeclarationName,
Expand Down Expand Up @@ -41,7 +39,12 @@ impl Counts {
// This is not a big problem - allocating a `Vec` with excess capacity is cheap.
// It's allocating with *not enough* capacity which is costly, as then the `Vec`
// will grow and reallocate.
assert_le!(actual.symbols, estimated.symbols, "symbols count mismatch");
assert!(
actual.symbols <= estimated.symbols,
"symbols count mismatch {} <= {}",
actual.symbols,
estimated.symbols
);
}
}

Expand Down

0 comments on commit 7dfcdfc

Please sign in to comment.