mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
xous: String: implement AsRef<str>
This allows xous Strings to be used in functions that expect to be able to stringify arguments. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
0f455a9a02
commit
32ebee0b8f
1 changed files with 7 additions and 1 deletions
|
|
@ -223,6 +223,12 @@ impl<const N: usize> core::fmt::Debug for String<N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<const N: usize> core::convert::AsRef<str> for String<N> {
|
||||||
|
fn as_ref(&self) -> &str {
|
||||||
|
self.to_str()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct ArchivedString {
|
pub struct ArchivedString {
|
||||||
ptr: rkyv::RelPtr<str>,
|
ptr: rkyv::RelPtr<str>,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue