Skip to content

Make this crate no_std #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions src/tables.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
Loading