diff --git a/sdk/rust/zx/src/channel/mod.rs b/sdk/rust/zx/src/channel/mod.rs
index d8100db..b0f5ec1 100644
--- a/sdk/rust/zx/src/channel/mod.rs
+++ b/sdk/rust/zx/src/channel/mod.rs
@@ -154,8 +154,8 @@
) -> Result<(), Status> {
loop {
// Ensure the capacity slices are the entire `Vec`s.
- bytes.truncate(0);
- handles.truncate(0);
+ bytes.clear();
+ handles.clear();
match self.read_uninit(bytes.spare_capacity_mut(), handles.spare_capacity_mut()) {
ChannelReadResult::Ok((byte_slice, handle_slice)) => {
// Drop the output slices before mutating the input buffers.
diff --git a/src/developer/ffx/command/src/describe.rs b/src/developer/ffx/command/src/describe.rs
index bc9a3be..bdb2e91 100644
--- a/src/developer/ffx/command/src/describe.rs
+++ b/src/developer/ffx/command/src/describe.rs
@@ -69,7 +69,7 @@
fn new_line(current_line: &mut String, out: &mut String) {
out.push('\n');
out.push_str(current_line);
- current_line.truncate(0);
+ current_line.clear();
}
#[cfg(test)]
diff --git a/src/developer/ffx/daemon/target/src/overnet/host_pipe.rs b/src/developer/ffx/daemon/target/src/overnet/host_pipe.rs
index 04840dd..1f5adcb 100644
--- a/src/developer/ffx/daemon/target/src/overnet/host_pipe.rs
+++ b/src/developer/ffx/daemon/target/src/overnet/host_pipe.rs
@@ -61,7 +61,7 @@
pub fn clear(&self) {
let mut buf = self.buf.borrow_mut();
- buf.truncate(0);
+ buf.clear();
}
}
diff --git a/src/lib/fidl/rust/fidl/src/encoding.rs b/src/lib/fidl/rust/fidl/src/encoding.rs
index 1510a83..b8bbbf8 100644
--- a/src/lib/fidl/rust/fidl/src/encoding.rs
+++ b/src/lib/fidl/rust/fidl/src/encoding.rs
@@ -829,7 +829,7 @@
(padding_ptr as *mut u64).write_unaligned(0);
}
}
- handles.truncate(0);
+ handles.clear();
Encoder { buf, handles, context, _dialect: PhantomData }
}
let mut encoder = prepare_for_encoding(context, buf, handles, T::inline_size(context));
diff --git a/src/lib/test_diagnostics/rust/src/lib.rs b/src/lib/test_diagnostics/rust/src/lib.rs
index c4277d3..9c1fc2c 100644
--- a/src/lib/test_diagnostics/rust/src/lib.rs
+++ b/src/lib/test_diagnostics/rust/src/lib.rs
@@ -182,7 +182,7 @@
None => self.writer.write(bytes),
Some(buf) if buf.len() + bytes.len() > self.max_capacity => {
self.writer.write_all(&buf)?;
- buf.truncate(0);
+ buf.clear();
self.writer.write(bytes)
}
Some(buf) => Write::write(buf, bytes),