Skip to content

Commit

Permalink
Merge pull request #265 from str4d/264-republish-sealed-trait
Browse files Browse the repository at this point in the history
Make the sealed `CollapsePrivate` trait public again
  • Loading branch information
jonhoo authored Sep 29, 2022
2 parents 3c97575 + 710584b commit 635527c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

### Fixed
- Reverted an internal cleanup from 0.11.8 to fix compilation. [#265](https://github.com/jonhoo/inferno/pull/265)

## [0.11.8] - 2022-09-27
### Changed
- Revert broken Firefox canvas height computation change. [#263](https://github.com/jonhoo/inferno/pull/263)
Expand Down
9 changes: 6 additions & 3 deletions src/collapse/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ pub static DEFAULT_NTHREADS: Lazy<usize> = Lazy::new(num_cpus::get);
#[doc(hidden)]
pub static DEFAULT_NTHREADS: Lazy<usize> = Lazy::new(|| 1);

/// Private trait for internal library authors.
/// Sealed trait for internal library authors.
///
/// If you implement this trait, your type will implement the public-facing
/// `Collapse` trait as well. Implementing this trait gives you parallelism
/// for free as long as you adhere to the requirements described in the
/// comments below.
pub(crate) trait CollapsePrivate: Send + Sized {
pub trait CollapsePrivate: Send + Sized {
// *********************************************************** //
// ********************* REQUIRED METHODS ******************** //
// *********************************************************** //
Expand Down Expand Up @@ -351,8 +351,11 @@ pub(crate) trait CollapsePrivate: Send + Sized {
/// Occurrences is a HashMap, which uses:
/// * AHashMap if single-threaded
/// * DashMap if multi-threaded
///
/// This is public because it is part of the sealed `CollapsePrivate` trait's API, but it
/// is in a crate-private module so is not nameable by downstream library users.
#[derive(Clone, Debug)]
pub(crate) enum Occurrences {
pub enum Occurrences {
SingleThreaded(AHashMap<String, usize>),
#[cfg(feature = "multithreaded")]
MultiThreaded(Arc<DashMap<String, usize, ahash::RandomState>>),
Expand Down

0 comments on commit 635527c

Please sign in to comment.