Skip to content

Commit f97392a

Browse files
committed
Use slice syntax instead of .as_slice on Vec
1 parent 74c4ef8 commit f97392a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl CStrBuf {
432432
/// If the given vector contains a NUL byte, then an error containing
433433
/// the original vector and `NulError` information is returned.
434434
pub fn from_vec(vec: Vec<u8>) -> Result<CStrBuf, IntoCStrError> {
435-
if let Some(pos) = vec.as_slice().position_elem(&NUL) {
435+
if let Some(pos) = vec[].position_elem(&NUL) {
436436
return Err(IntoCStrError {
437437
cause: NulError { position: pos },
438438
bytes: vec

0 commit comments

Comments
 (0)