diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 541d58a..682dd21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/checkout@v3 - uses: sfackler/actions/rustup@master with: - version: 1.56.0 + version: 1.81.0 - run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT id: rust-version - uses: actions/cache@v3 diff --git a/Cargo.toml b/Cargo.toml index e7223e5..5b73efd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ license = "MIT/Apache-2.0" description = "An implementation of the stringprep algorithm" repository = "https://github.com/sfackler/rust-stringprep" readme = "README.md" +rust-version = "1.81.0" # For core::error::Error [dependencies] unicode-bidi = "0.3" diff --git a/src/lib.rs b/src/lib.rs index 7027761..8945ccb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,13 +1,16 @@ //! An implementation of the "stringprep" algorithm defined in [RFC 3454][]. //! //! [RFC 3454]: https://tools.ietf.org/html/rfc3454 +#![no_std] #![warn(missing_docs)] +extern crate alloc; extern crate unicode_bidi; extern crate unicode_normalization; extern crate unicode_properties; -use std::borrow::Cow; -use std::fmt; +use alloc::borrow::Cow; +use alloc::string::String; +use core::fmt; use unicode_normalization::UnicodeNormalization; use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory}; @@ -44,7 +47,7 @@ impl fmt::Display for Error { } } -impl std::error::Error for Error {} +impl core::error::Error for Error {} /// Prepares a string with the SASLprep profile of the stringprep algorithm. /// diff --git a/src/tables.rs b/src/tables.rs index 3eccb35..ecee304 100644 --- a/src/tables.rs +++ b/src/tables.rs @@ -1,6 +1,6 @@ //! Character Tables -use std::cmp::Ordering; -use std::str::Chars; +use core::cmp::Ordering; +use core::str::Chars; use unicode_bidi::{bidi_class, BidiClass}; use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory};