jid: Make the crate no_std

Only std::error::Error is missing in this mode, but that’s only waiting
for its stabilisation, see this issue:
https://github.com/rust-lang/rust/issues/103765
This commit is contained in:
Emmanuel Gil Peyrot 2024-04-25 21:18:39 +02:00 committed by pep
commit 48f77acb69
4 changed files with 35 additions and 17 deletions

View file

@ -8,8 +8,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use core::fmt;
#[cfg(feature = "std")]
use std::error::Error as StdError;
use std::fmt;
/// An error that signifies that a `Jid` cannot be parsed from a string.
#[derive(Debug, PartialEq, Eq)]
@ -49,6 +50,7 @@ pub enum Error {
ResourceInBareJid,
}
#[cfg(feature = "std")]
impl StdError for Error {}
impl fmt::Display for Error {