mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +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)]
|
||||
pub struct ArchivedString {
|
||||
ptr: rkyv::RelPtr<str>,
|
||||
|
|
@ -296,4 +302,4 @@ impl<const N: usize> Eq for String<N> {}
|
|||
pub struct XousDeserializer;
|
||||
impl rkyv::Fallible for XousDeserializer {
|
||||
type Error = crate::Error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue