diff --git a/src/tempfile.rs b/src/tempfile.rs index 7d980ef..45cb656 100644 --- a/src/tempfile.rs +++ b/src/tempfile.rs @@ -61,10 +61,10 @@ impl TempFile { let raw_fname = CString::new(os_fname.into_vec()).unwrap().into_raw(); - // Safe because I'm sure `raw_fname` is a valid CString. + // SAFETY: Safe because I'm sure `raw_fname` is a valid CString. let fd = unsafe { libc::mkstemp(raw_fname) }; - // The `raw_fname` is the same as `os_fname` (which is `prefix` with X's + // SAFETY: The `raw_fname` is the same as `os_fname` (which is `prefix` with X's // appended). The X's are documented as "six characters" which seem to // always be alphanumerics so appears safe. let c_tempname = unsafe { CString::from_raw(raw_fname) }; @@ -74,7 +74,7 @@ impl TempFile { return errno_result(); } - // Safe because we checked `fd != -1` above and we uniquely own the file + // SAFETY: Safe because we checked `fd != -1` above and we uniquely own the file // descriptor. This `fd` will be freed etc when `File` and thus // `TempFile` goes out of scope. let file = unsafe { File::from_raw_fd(fd) };