diff options
author | 2023-01-27 13:25:04 -0700 | |
---|---|---|
committer | 2023-01-27 14:02:48 -0700 | |
commit | 42b1bfe66d2407901c1ae640f80ce9e0d3c64b60 (patch) | |
tree | 2057c57df0c36096d1c3cd6334bc16e767f8169e /native/src | |
parent | e6092e81a42efe0bbaaad2e7ce475c25a379e672 (diff) | |
download | iced-42b1bfe66d2407901c1ae640f80ce9e0d3c64b60.tar.gz iced-42b1bfe66d2407901c1ae640f80ce9e0d3c64b60.tar.bz2 iced-42b1bfe66d2407901c1ae640f80ce9e0d3c64b60.zip |
Fix: Clippy lint 'uninlined_format_args'
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/command/action.rs | 6 | ||||
-rw-r--r-- | native/src/debug/basic.rs | 8 | ||||
-rw-r--r-- | native/src/image.rs | 4 | ||||
-rw-r--r-- | native/src/svg.rs | 2 | ||||
-rw-r--r-- | native/src/widget/operation.rs | 2 | ||||
-rw-r--r-- | native/src/window/action.rs | 11 |
6 files changed, 16 insertions, 17 deletions
diff --git a/native/src/command/action.rs b/native/src/command/action.rs index a6954f8f..a51b8c21 100644 --- a/native/src/command/action.rs +++ b/native/src/command/action.rs @@ -58,10 +58,10 @@ impl<T> fmt::Debug for Action<T> { match self { Self::Future(_) => write!(f, "Action::Future"), Self::Clipboard(action) => { - write!(f, "Action::Clipboard({:?})", action) + write!(f, "Action::Clipboard({action:?})") } - Self::Window(action) => write!(f, "Action::Window({:?})", action), - Self::System(action) => write!(f, "Action::System({:?})", action), + Self::Window(action) => write!(f, "Action::Window({action:?})"), + Self::System(action) => write!(f, "Action::System({action:?})"), Self::Widget(_action) => write!(f, "Action::Widget"), } } diff --git a/native/src/debug/basic.rs b/native/src/debug/basic.rs index 603f2fd5..92f614da 100644 --- a/native/src/debug/basic.rs +++ b/native/src/debug/basic.rs @@ -133,7 +133,7 @@ impl Debug { } pub fn log_message<Message: std::fmt::Debug>(&mut self, message: &Message) { - self.last_messages.push_back(format!("{:?}", message)); + self.last_messages.push_back(format!("{message:?}")); if self.last_messages.len() > 10 { let _ = self.last_messages.pop_front(); @@ -150,7 +150,7 @@ impl Debug { let mut lines = Vec::new(); fn key_value<T: std::fmt::Debug>(key: &str, value: T) -> String { - format!("{} {:?}", key, value) + format!("{key} {value:?}") } lines.push(format!( @@ -176,9 +176,9 @@ impl Debug { lines.push(String::from("Last messages:")); lines.extend(self.last_messages.iter().map(|msg| { if msg.len() <= 100 { - format!(" {}", msg) + format!(" {msg}") } else { - format!(" {:.100}...", msg) + format!(" {msg:.100}...") } })); diff --git a/native/src/image.rs b/native/src/image.rs index 06fd7ae6..5d2843c9 100644 --- a/native/src/image.rs +++ b/native/src/image.rs @@ -107,10 +107,10 @@ pub enum Data { impl std::fmt::Debug for Data { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Data::Path(path) => write!(f, "Path({:?})", path), + Data::Path(path) => write!(f, "Path({path:?})"), Data::Bytes(_) => write!(f, "Bytes(...)"), Data::Rgba { width, height, .. } => { - write!(f, "Pixels({} * {})", width, height) + write!(f, "Pixels({width} * {height})") } } } diff --git a/native/src/svg.rs b/native/src/svg.rs index 2168e409..9b98877a 100644 --- a/native/src/svg.rs +++ b/native/src/svg.rs @@ -71,7 +71,7 @@ pub enum Data { impl std::fmt::Debug for Data { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Data::Path(path) => write!(f, "Path({:?})", path), + Data::Path(path) => write!(f, "Path({path:?})"), Data::Bytes(_) => write!(f, "Bytes(...)"), } } diff --git a/native/src/widget/operation.rs b/native/src/widget/operation.rs index 73e6a6b0..53688a21 100644 --- a/native/src/widget/operation.rs +++ b/native/src/widget/operation.rs @@ -62,7 +62,7 @@ where fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::None => write!(f, "Outcome::None"), - Self::Some(output) => write!(f, "Outcome::Some({:?})", output), + Self::Some(output) => write!(f, "Outcome::Some({output:?})"), Self::Chain(_) => write!(f, "Outcome::Chain(...)"), } } diff --git a/native/src/window/action.rs b/native/src/window/action.rs index 37fcc273..525434e4 100644 --- a/native/src/window/action.rs +++ b/native/src/window/action.rs @@ -106,15 +106,14 @@ impl<T> fmt::Debug for Action<T> { Self::Drag => write!(f, "Action::Drag"), Self::Resize { width, height } => write!( f, - "Action::Resize {{ widget: {}, height: {} }}", - width, height + "Action::Resize {{ widget: {width}, height: {height} }}" ), - Self::Maximize(value) => write!(f, "Action::Maximize({})", value), - Self::Minimize(value) => write!(f, "Action::Minimize({}", value), + Self::Maximize(value) => write!(f, "Action::Maximize({value})"), + Self::Minimize(value) => write!(f, "Action::Minimize({value}"), Self::Move { x, y } => { - write!(f, "Action::Move {{ x: {}, y: {} }}", x, y) + write!(f, "Action::Move {{ x: {x}, y: {y} }}") } - Self::SetMode(mode) => write!(f, "Action::SetMode({:?})", mode), + Self::SetMode(mode) => write!(f, "Action::SetMode({mode:?})"), Self::FetchMode(_) => write!(f, "Action::FetchMode"), Self::ToggleMaximize => write!(f, "Action::ToggleMaximize"), Self::ToggleDecorations => write!(f, "Action::ToggleDecorations"), |