mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(parser): shorten UniquePromise code (#5805)
Pure refactor. Shorten code a little.
This commit is contained in:
parent
2322b8b713
commit
31e9db442d
1 changed files with 3 additions and 5 deletions
|
|
@ -178,14 +178,12 @@ mod parser_parse {
|
|||
///
|
||||
/// `UniquePromise::new_for_benchmarks` is a backdoor for benchmarks, so they can create a
|
||||
/// `ParserImpl` or `Lexer`, and manipulate it directly, for testing/benchmarking purposes.
|
||||
pub(crate) struct UniquePromise {
|
||||
_dummy: (),
|
||||
}
|
||||
pub(crate) struct UniquePromise(());
|
||||
|
||||
impl UniquePromise {
|
||||
#[inline]
|
||||
fn new() -> Self {
|
||||
Self { _dummy: () }
|
||||
Self(())
|
||||
}
|
||||
|
||||
/// Backdoor for tests/benchmarks to create a `UniquePromise` (see above).
|
||||
|
|
@ -193,7 +191,7 @@ mod parser_parse {
|
|||
/// as it allows circumventing safety invariants of the parser.
|
||||
#[cfg(feature = "benchmarking")]
|
||||
pub fn new_for_benchmarks() -> Self {
|
||||
Self { _dummy: () }
|
||||
Self(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue