Skip to content

Commit

Permalink
Merge pull request #67 from mleonhard/master
Browse files Browse the repository at this point in the history
Remove single use of `unsafe`.
  • Loading branch information
sile authored Mar 25, 2022
2 parents 32d9947 + b91f6a6 commit d6ec2d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gzip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ where
let mut cbuf = [0; 1];
reader.read_exact(&mut cbuf)?;
if cbuf[0] == 0 {
return Ok(unsafe { CString::from_vec_unchecked(buf) });
return Ok(CString::new(buf).unwrap());
}
buf.push(cbuf[0]);
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! A Rust implementation of DEFLATE algorithm and related formats (ZLIB, GZIP).
#![forbid(unsafe_code)]
#![warn(missing_docs)]
pub use finish::Finish;

Expand Down

0 comments on commit d6ec2d2

Please sign in to comment.