Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 132 additions & 19 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions oscars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ hashbrown = "0.16.1"
oscars_derive = { path = "../oscars_derive", version = "0.1.0" }
rustc-hash = "2.1.1"
thin-vec = { version = "0.2", optional = true }
# Optional Trace/Finalize impls for external types.
boa_string = { git = "https://github.com/boa-dev/boa.git", branch = "main", optional = true }
icu_locale_core = { version = "2.2.0", default-features = false, optional = true }
either = { version = "1.16.0", optional = true }
arrayvec = { version = "0.7.6", optional = true }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
Expand Down Expand Up @@ -39,3 +44,7 @@ mark_sweep_branded = ["mark_sweep"]
null_collector = ["mark_sweep"]
null_collector_branded = ["mark_sweep"]
thin-vec = ["dep:thin-vec", "mark_sweep"]
boa_string = ["dep:boa_string", "mark_sweep"]
icu = ["dep:icu_locale_core", "mark_sweep"]
either = ["dep:either", "mark_sweep"]
arrayvec = ["dep:arrayvec", "mark_sweep"]
24 changes: 24 additions & 0 deletions oscars/src/collectors/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,27 @@ impl<T: Finalize> Finalize for OnceCell<T> {}
impl<T: ToOwned + Finalize + ?Sized> Finalize for Cow<'static, T> where T::Owned: Finalize {}

impl<T> Finalize for PhantomData<T> {}

#[cfg(feature = "icu")]
impl Finalize for icu_locale_core::LanguageIdentifier {}

#[cfg(feature = "icu")]
impl Finalize for icu_locale_core::Locale {}

#[cfg(feature = "boa_string")]
impl Finalize for boa_string::JsString {}

#[cfg(feature = "either")]
impl<L: Finalize, R: Finalize> Finalize for either::Either<L, R> {}

#[cfg(feature = "arrayvec")]
impl<T: Finalize, const N: usize> Finalize for arrayvec::ArrayVec<T, N> {}

#[cfg(feature = "std")]
impl Finalize for std::path::Path {}
#[cfg(feature = "std")]
impl Finalize for std::path::PathBuf {}
#[cfg(feature = "std")]
impl Finalize for std::time::Instant {}
#[cfg(feature = "std")]
impl Finalize for std::time::SystemTime {}
Loading
Loading