From d5b2320a59b338f1ac42c27c191ec659a63f14fb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 6 Jul 2021 12:30:12 +0200 Subject: [PATCH] Fix clippy warning Useless use of format --- src/uu/hostname/src/hostname.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/uu/hostname/src/hostname.rs b/src/uu/hostname/src/hostname.rs index 5f05fa05c..14f8b9df2 100644 --- a/src/uu/hostname/src/hostname.rs +++ b/src/uu/hostname/src/hostname.rs @@ -17,6 +17,8 @@ use clap::{crate_version, App, Arg, ArgMatches}; use std::collections::hash_set::HashSet; use std::net::ToSocketAddrs; use std::str; +#[cfg(windows)] +use uucore::error::UUsageError; use uucore::error::{UResult, USimpleError}; #[cfg(windows)] @@ -40,7 +42,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { #[allow(deprecated)] let mut data = std::mem::uninitialized(); if WSAStartup(MAKEWORD(2, 2), &mut data as *mut _) != 0 { - return Err(USimpleError::new(1, format!("Failed to start Winsock 2.2"))); + return Err(UUsageError::new( + 1, + "Failed to start Winsock 2.2".to_string(), + )); } } let result = execute(args);