mirror of
https://github.com/YaLTeR/niri.git
synced 2025-10-06 00:23:14 +02:00
Fix new Clippy warnings
This commit is contained in:
@@ -3079,7 +3079,7 @@ impl<S: knuffel::traits::ErrorSpan> knuffel::DecodeScalar<S> for WorkspaceName {
|
||||
ctx.emit_error(DecodeError::unexpected(
|
||||
val,
|
||||
"named workspace",
|
||||
format!("duplicate named workspace: {}", s),
|
||||
format!("duplicate named workspace: {s}"),
|
||||
));
|
||||
return Ok(Self(String::new()));
|
||||
}
|
||||
|
@@ -95,8 +95,7 @@ fn wiki_docs_parses() {
|
||||
}
|
||||
} else if must_fail {
|
||||
errors.push(format!(
|
||||
"Expected error parsing wiki KDL code block at {}:{}",
|
||||
filename, line_number
|
||||
"Expected error parsing wiki KDL code block at {filename}:{line_number}",
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@@ -316,11 +316,11 @@ impl Tty {
|
||||
|
||||
let mut node_path = String::new();
|
||||
if let Some(path) = primary_render_node.dev_path() {
|
||||
write!(node_path, "{:?}", path).unwrap();
|
||||
write!(node_path, "{path:?}").unwrap();
|
||||
} else {
|
||||
write!(node_path, "{}", primary_render_node).unwrap();
|
||||
write!(node_path, "{primary_render_node}").unwrap();
|
||||
}
|
||||
info!("using as the render node: {}", node_path);
|
||||
info!("using as the render node: {node_path}");
|
||||
|
||||
Ok(Self {
|
||||
config,
|
||||
|
@@ -189,8 +189,7 @@ impl DisplayConfig {
|
||||
for (connector, mode, _props) in requested_config.monitors {
|
||||
if !current_conf.values().any(|o| o.name == connector) {
|
||||
return Err(zbus::fdo::Error::Failed(format!(
|
||||
"Connector '{}' not found",
|
||||
connector
|
||||
"Connector '{connector}' not found",
|
||||
)));
|
||||
}
|
||||
new_conf.insert(
|
||||
@@ -210,8 +209,7 @@ impl DisplayConfig {
|
||||
7 => niri_ipc::Transform::Flipped270,
|
||||
x => {
|
||||
return Err(zbus::fdo::Error::Failed(format!(
|
||||
"Unknown transform {}",
|
||||
x
|
||||
"Unknown transform {x}",
|
||||
)))
|
||||
}
|
||||
},
|
||||
@@ -220,10 +218,7 @@ impl DisplayConfig {
|
||||
y: requested_config.y,
|
||||
}),
|
||||
mode: Some(niri_ipc::ConfiguredMode::from_str(&mode).map_err(|e| {
|
||||
zbus::fdo::Error::Failed(format!(
|
||||
"Could not parse mode '{}': {}",
|
||||
mode, e
|
||||
))
|
||||
zbus::fdo::Error::Failed(format!("Could not parse mode '{mode}': {e}"))
|
||||
})?),
|
||||
// FIXME: VRR
|
||||
..Default::default()
|
||||
|
@@ -120,7 +120,7 @@ impl ScreenCast {
|
||||
|
||||
static NUMBER: AtomicUsize = AtomicUsize::new(0);
|
||||
let session_id = NUMBER.fetch_add(1, Ordering::SeqCst);
|
||||
let path = format!("/org/gnome/Mutter/ScreenCast/Session/u{}", session_id);
|
||||
let path = format!("/org/gnome/Mutter/ScreenCast/Session/u{session_id}");
|
||||
let path = OwnedObjectPath::try_from(path).unwrap();
|
||||
|
||||
let session = Session::new(session_id, self.ipc_outputs.clone(), self.to_niri.clone());
|
||||
|
@@ -297,7 +297,7 @@ pub fn handle_msg(msg: Msg, json: bool) -> anyhow::Result<()> {
|
||||
let [r, g, b] = color.rgb.map(|v| (v.clamp(0., 1.) * 255.).round() as u8);
|
||||
|
||||
println!("Picked color: rgb({r}, {g}, {b})",);
|
||||
println!("Hex: #{:02x}{:02x}{:02x}", r, g, b);
|
||||
println!("Hex: #{r:02x}{g:02x}{b:02x}");
|
||||
} else {
|
||||
println!("No color was picked.");
|
||||
}
|
||||
|
@@ -5242,7 +5242,7 @@ impl Niri {
|
||||
|
||||
let dbus = &self.dbus.as_ref().unwrap();
|
||||
let server = dbus.conn_screen_cast.as_ref().unwrap().object_server();
|
||||
let path = format!("/org/gnome/Mutter/ScreenCast/Session/u{}", session_id);
|
||||
let path = format!("/org/gnome/Mutter/ScreenCast/Session/u{session_id}");
|
||||
if let Ok(iface) = server.interface::<_, mutter_screen_cast::Session>(path) {
|
||||
let _span = tracy_client::span!("invoking Session::stop");
|
||||
|
||||
|
@@ -70,9 +70,9 @@ unsafe fn compile_program(
|
||||
texture_uniforms: &[&str],
|
||||
// destruction_callback_sender: Sender<CleanupResource>,
|
||||
) -> Result<ShaderProgram, GlesError> {
|
||||
let shader = format!("#version 100\n{}", src);
|
||||
let shader = format!("#version 100\n{src}");
|
||||
let program = unsafe { link_program(gl, include_str!("shaders/texture.vert"), &shader)? };
|
||||
let debug_shader = format!("#version 100\n#define DEBUG_FLAGS\n{}", src);
|
||||
let debug_shader = format!("#version 100\n#define DEBUG_FLAGS\n{src}");
|
||||
let debug_program =
|
||||
unsafe { link_program(gl, include_str!("shaders/texture.vert"), &debug_shader)? };
|
||||
|
||||
|
@@ -187,8 +187,7 @@ fn render(
|
||||
if let Some(path) = created_path {
|
||||
text = format!(
|
||||
"Created a default config file at \
|
||||
<span face='monospace' bgcolor='#000000'>{:?}</span>",
|
||||
path
|
||||
<span face='monospace' bgcolor='#000000'>{path:?}</span>",
|
||||
);
|
||||
border_color = (0.5, 1., 0.5);
|
||||
};
|
||||
|
Reference in New Issue
Block a user