wip: Various refactorings and improvements
This commit is contained in:
parent
702ea033af
commit
37f978d1b3
33 changed files with 744 additions and 1229 deletions
9
src/utils.rs
Normal file
9
src/utils.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use static_rc::StaticRc;
|
||||
|
||||
/// Uses [`StaticRc`] to create two halves of value with shared ownership, with no runtime reference counting required.
|
||||
pub(crate) fn static_rc_halves<T>(value: T) -> (StaticRc<T, 1, 3>, StaticRc<T, 2, 3>) {
|
||||
StaticRc::split::<1, 2>(StaticRc::<T, 3, 3>::new(value))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue