Improve string functions.
This commit is contained in:
@@ -344,7 +344,7 @@ impl<'a> NativeCallContext<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Consume a [`Shared`] resource and return a mutable reference to the wrapped value.
|
||||
/// Return a mutable reference to the wrapped value of a [`Shared`] resource.
|
||||
/// If the resource is shared (i.e. has other outstanding references), a cloned copy is used.
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
@@ -353,6 +353,14 @@ pub fn shared_make_mut<T: Clone>(value: &mut Shared<T>) -> &mut T {
|
||||
Shared::make_mut(value)
|
||||
}
|
||||
|
||||
/// Return a mutable reference to the wrapped value of a [`Shared`] resource.
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
#[allow(dead_code)]
|
||||
pub fn shared_get_mut<T: Clone>(value: &mut Shared<T>) -> Option<&mut T> {
|
||||
Shared::get_mut(value)
|
||||
}
|
||||
|
||||
/// Consume a [`Shared`] resource if is unique (i.e. not shared), or clone it otherwise.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
|
Reference in New Issue
Block a user