feat: add no_std support in appropriate crates

This commit is contained in:
Greg Johnston 2024-02-07 18:38:44 -05:00
parent 63dacdcc95
commit 9ca1cba504
3 changed files with 4 additions and 3 deletions

View file

@ -1,8 +1,10 @@
#![no_std]
pub(crate) const MAX_TEMPLATE_SIZE: usize = 4096;
/// Converts a zero-terminated buffer of bytes into a UTF-8 string.
pub const fn str_from_buffer(buf: &[u8; MAX_TEMPLATE_SIZE]) -> &str {
match std::ffi::CStr::from_bytes_until_nul(buf) {
match core::ffi::CStr::from_bytes_until_nul(buf) {
Ok(cstr) => match cstr.to_str() {
Ok(str) => str,
Err(_) => panic!("TEMPLATE FAILURE"),

View file

@ -3,6 +3,4 @@ name = "next_tuple"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View file

@ -1,3 +1,4 @@
#![no_std]
#![allow(non_snake_case)]
pub trait TupleBuilder<Next> {