Skip to content

Commit 9babfb3

Browse files
committed
Make this crate no_std
As nothing actually depends on std, there is no need to keep a dependency on it. This allows users such as the jid crate to actually be no_std as well.
1 parent 97e2588 commit 9babfb3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/lib.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
//! An implementation of the "stringprep" algorithm defined in [RFC 3454][].
22
//!
33
//! [RFC 3454]: https://tools.ietf.org/html/rfc3454
4+
#![no_std]
45
#![warn(missing_docs)]
6+
extern crate alloc;
57
extern crate unicode_bidi;
68
extern crate unicode_normalization;
79
extern crate unicode_properties;
810

9-
use std::borrow::Cow;
10-
use std::fmt;
11+
use alloc::borrow::Cow;
12+
use alloc::string::String;
13+
use core::fmt;
1114
use unicode_normalization::UnicodeNormalization;
1215
use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory};
1316

@@ -44,7 +47,7 @@ impl fmt::Display for Error {
4447
}
4548
}
4649

47-
impl std::error::Error for Error {}
50+
impl core::error::Error for Error {}
4851

4952
/// Prepares a string with the SASLprep profile of the stringprep algorithm.
5053
///

src/tables.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Character Tables
2-
use std::cmp::Ordering;
3-
use std::str::Chars;
2+
use core::cmp::Ordering;
3+
use core::str::Chars;
44
use unicode_bidi::{bidi_class, BidiClass};
55
use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory};
66

0 commit comments

Comments
 (0)