diff --git a/Cargo.toml b/Cargo.toml index a04b55a..bc01fc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "arccstr" -version = "1.0.1" +version = "1.0.2" description = "Thread-safe, reference-counted null-terminated immutable strings." readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index a453be3..725d675 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -218,7 +218,7 @@ impl ArcCStr { alloc::heap::Heap .alloc(aul) .expect("could not allocate memory"), - ); + ).unwrap(); let cstr = s.as_ptr().offset(aus as isize); // initialize the AtomicUsize to 1 { @@ -231,7 +231,7 @@ impl ArcCStr { *cstr.offset(buf.len() as isize) = 0u8; // and we're all good ArcCStr { - ptr: Shared::new(s.as_ptr().offset(0)), + ptr: Shared::new(s.as_ptr().offset(0)).unwrap(), } }