File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,6 @@ readme = "README.md"
1111unicode-bidi = " 0.3"
1212unicode-normalization = " 0.1"
1313unicode-properties = " 0.1.1"
14+
15+ [features ]
16+ std = []
Original file line number Diff line number Diff line change 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;
57extern crate unicode_bidi;
68extern crate unicode_normalization;
79extern crate unicode_properties;
810
9- use std:: borrow:: Cow ;
10- use std:: fmt;
11+ #[ cfg( feature = "std" ) ]
12+ extern crate std;
13+
14+ use alloc:: borrow:: Cow ;
15+ use alloc:: string:: String ;
16+ use core:: fmt;
1117use unicode_normalization:: UnicodeNormalization ;
1218use unicode_properties:: { GeneralCategoryGroup , UnicodeGeneralCategory } ;
1319
@@ -44,7 +50,12 @@ impl fmt::Display for Error {
4450 }
4551}
4652
53+ // This is only needed for Rust versions older than 1.81.0, before core::error::Error got
54+ // stabilized.
55+ #[ cfg( feature = "std" ) ]
4756impl std:: error:: Error for Error { }
57+ #[ cfg( not( feature = "std" ) ) ]
58+ impl core:: error:: Error for Error { }
4859
4960/// Prepares a string with the SASLprep profile of the stringprep algorithm.
5061///
Original file line number Diff line number Diff line change 11//! Character Tables
2- use std :: cmp:: Ordering ;
3- use std :: str:: Chars ;
2+ use core :: cmp:: Ordering ;
3+ use core :: str:: Chars ;
44use unicode_bidi:: { bidi_class, BidiClass } ;
55use unicode_properties:: { GeneralCategoryGroup , UnicodeGeneralCategory } ;
66
You can’t perform that action at this time.
0 commit comments