base: remove redundant &format!() reference

Fixes clippy lint in Rust 1.68

BUG=b:276487055
TEST=tools/clippy # with rust 1.68

Change-Id: I6754dc4f93c7c2fadfa03f240cae3e2e4a86e225
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391103
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2023-03-31 14:47:24 -07:00 committed by crosvm LUCI
parent 87134857f0
commit 99e8506da6

View file

@ -36,7 +36,7 @@ fn unix_seqpacket_listener_from_fd() {
UnixSeqpacketListener::bind(&socket_path).expect("failed to create UnixSeqpacketListener"),
);
// UnixSeqpacketListener should succeed on a valid listening descriptor.
let good_dup = UnixSeqpacketListener::bind(&format!("/proc/self/fd/{}", unsafe {
let good_dup = UnixSeqpacketListener::bind(format!("/proc/self/fd/{}", unsafe {
libc::dup(listener.as_raw_descriptor())
}));
let good_dup_path = good_dup
@ -46,7 +46,7 @@ fn unix_seqpacket_listener_from_fd() {
assert!(good_dup_path.is_err());
// UnixSeqpacketListener must fail on an existing non-listener socket.
let s1 = UnixSeqpacket::connect(socket_path.as_path()).expect("UnixSeqpacket::connect failed");
let bad_dup = UnixSeqpacketListener::bind(&format!("/proc/self/fd/{}", unsafe {
let bad_dup = UnixSeqpacketListener::bind(format!("/proc/self/fd/{}", unsafe {
libc::dup(s1.as_raw_descriptor())
}));
assert!(bad_dup.is_err());