tokio_xmpp: Replace std stuff with alloc/core stuff

This commit is contained in:
xmppftw xmppftw 2024-12-19 19:34:10 +01:00 committed by Emmanuel Gil Peyrot
commit 1ce2f894aa
12 changed files with 27 additions and 28 deletions

View file

@ -114,7 +114,7 @@ struct LogXsoBuf<'x>(&'x [u8]);
impl<'x> fmt::Display for LogXsoBuf<'x> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// We always generate UTF-8, so this should be good... I think.
let text = std::str::from_utf8(&self.0).unwrap();
let text = core::str::from_utf8(&self.0).unwrap();
#[cfg(feature = "syntax-highlighting")]
let text = highlight_xml(text);
f.write_str(&text)
@ -195,7 +195,7 @@ impl fmt::Display for ReadError {
}
impl core::error::Error for ReadError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match self {
ReadError::HardError(e) => Some(e),
ReadError::ParseError(e) => Some(e),