summary refs log tree commit diff
path: root/ripple/minitrace
diff options
context:
space:
mode:
authorV <v@unfathomable.blue>2022-02-16 06:38:24 +0100
committerV <v@unfathomable.blue>2022-02-16 06:38:24 +0100
commitcfdee7b33e8ced500dd33821f103174ffd4d3e89 (patch)
tree4026968795aa5f62faaed1bb6a9e3a9fe64d1877 /ripple/minitrace
parent839075b6a45368239baa8e6fc5ae54aecbdf093a (diff)
downloadunf-legacy-cfdee7b33e8ced500dd33821f103174ffd4d3e89.tar.zst
ripple/minitrace: use CString::from_vec_with_nul for construction
New Rust version, fresh new APIs.

Change-Id: I0983ea45a27ec25c16b1a7ff4dc828540ccd0b5f
Diffstat (limited to 'ripple/minitrace')
-rw-r--r--ripple/minitrace/src/main.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs
index ca0ce65..bc22563 100644
--- a/ripple/minitrace/src/main.rs
+++ b/ripple/minitrace/src/main.rs
@@ -89,12 +89,7 @@ impl Process {
 		let mut buf = vec![];
 		mem.read_until(0, &mut buf)?;
 
-		// TODO(V): replace with CString::from_vec_with_nul when we update to Rust 1.58
-		if buf.pop() != Some(0) {
-			bail!("Couldn't find null terminator");
-		}
-
-		Ok(CString::new(buf).expect("logic error"))
+		Ok(CString::from_vec_with_nul(buf).expect("logic error"))
 	}
 }