Skip to content
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

to_bytes_until_nul() returns None if no null byte #22

Open
nallux-dozryl opened this issue Sep 8, 2024 · 0 comments
Open

to_bytes_until_nul() returns None if no null byte #22

nallux-dozryl opened this issue Sep 8, 2024 · 0 comments

Comments

@nallux-dozryl
Copy link

Not sure if it's intended behavior, but it's causing issues in http-app

Reproduce:

use crown::{Bytes};
use crown::{AtomExt};
use sword::noun::{Atom};
use sword::mem::NockStack;

fn main() {
    let atom = Atom::from_bytes(&mut NockStack::new(1 << 27, 0), &Bytes::from("1234567"));
    println!("{:?}", atom.to_bytes_until_nul()); // Some([49, 50, 51, 52, 53, 54, 55])
    let atom = Atom::from_bytes(&mut NockStack::new(1 << 27, 0), &Bytes::from("12345678"));
    println!("{:?}", atom.to_bytes_until_nul()); // None
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant