Ipmlement conversions from Account to (Arc|Box|Rc)<Acc>
Dependencies
- [2]
NG5QXPZHExtract Account into separate crate - [*]
YDK6X6PPadd a library of important types for beancount - [*]
2JBFREZGenable additional warnings
Change contents
- edit in beancount/types/src/core/account.rs at line 8[2.1750][5.13676]
use alloc::rc::Rc;use alloc::sync::Arc; - edit in beancount/types/src/core/account.rs at line 156
impl From<&Acc> for Arc<Acc> {fn from(value: &Acc) -> Self {let raw = Arc::<str>::from(&value.name);unsafe { Self::from_raw(Arc::into_raw(raw) as _) }}}impl From<Account> for Arc<Acc> {fn from(value: Account) -> Self {let raw = Arc::<str>::from(value.name);unsafe { Self::from_raw(Arc::into_raw(raw) as _) }}}impl From<&Acc> for Box<Acc> {fn from(value: &Acc) -> Self {let raw = Box::<str>::from(&value.name);unsafe { Self::from_raw(Box::into_raw(raw) as _) }}} - edit in beancount/types/src/core/account.rs at line 178
impl From<Account> for Box<Acc> {fn from(value: Account) -> Self {let raw = value.name.into_boxed_str();unsafe { Self::from_raw(Box::into_raw(raw) as _) }}}impl From<&Acc> for Rc<Acc> {fn from(value: &Acc) -> Self {let raw = Rc::<str>::from(&value.name);unsafe { Self::from_raw(Rc::into_raw(raw) as _) }}}impl From<Account> for Rc<Acc> {fn from(value: Account) -> Self {let raw = Rc::<str>::from(value.name);unsafe { Self::from_raw(Rc::into_raw(raw) as _) }}}