Skip to content

Commit

Permalink
make no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjfvi committed May 27, 2024
1 parent 31c1276 commit 35e172d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#![no_std]

extern crate alloc;

use alloc::{format, string::{String, ToString}};

use highlight_error::{*};

#[macro_export]
Expand Down Expand Up @@ -145,7 +151,7 @@ pub trait Parser<'i> {
if name.is_empty() {
self.expected("name")
} else {
Ok(name.to_owned())
Ok(name.to_string())
}
}

Expand Down Expand Up @@ -175,7 +181,7 @@ pub trait Parser<'i> {
let codepoint_str = self.take_while(|c| c.is_digit(16));
self.consume("}")?;
u32::from_str_radix(codepoint_str, 16)
.ok().and_then(std::char::from_u32)
.ok().and_then(core::char::from_u32)
.ok_or_else(|| self.expected::<char>("unicode-codepoint").unwrap_err())
}
Some('0') => Ok('\0'),
Expand Down

0 comments on commit 35e172d

Please sign in to comment.