mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-09-07 18:16:13 +00:00
chore: fix clippy
This commit is contained in:
parent
1a1d1682fe
commit
830344d665
17 changed files with 18 additions and 19 deletions
|
@ -22,7 +22,7 @@ impl Cmake {
|
|||
if k.contains(' ') {
|
||||
panic!("Cmake vars cannot contain spaces!");
|
||||
}
|
||||
args.push(format!("-D{k}={v}", k = k, v = v));
|
||||
args.push(format!("-D{k}={v}"));
|
||||
}
|
||||
}
|
||||
args.push(self.source_dir.to_string_lossy().to_string());
|
||||
|
|
|
@ -13,7 +13,7 @@ const CHUNK_SIZE: usize = 1024;
|
|||
|
||||
fn headers() -> HeaderMap {
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert(USER_AGENT, format!("{}/1.0", APP_ID).parse().unwrap());
|
||||
headers.insert(USER_AGENT, format!("{APP_ID}/1.0").parse().unwrap());
|
||||
headers
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ fn env_var_descriptions() -> Vec<(&'static str, &'static str)> {
|
|||
fn env_var_descriptions_as_paragraph() -> String {
|
||||
ENV_VAR_DESCRIPTIONS
|
||||
.iter()
|
||||
.map(|(k, v)| format!("<span size=\"large\" weight=\"bold\">{}</span>\n{}", k, v))
|
||||
.map(|(k, v)| format!("<span size=\"large\" weight=\"bold\">{k}</span>\n{v}"))
|
||||
.collect::<Vec<String>>()
|
||||
.join("\n\n")
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ fn list_gpus() -> Vec<GpuSysDrm> {
|
|||
|
||||
for i in 0..5 {
|
||||
// arbitrary range, find a better way
|
||||
let card_dir = PathBuf::from(format!("/sys/class/drm/card{}", i));
|
||||
let card_dir = PathBuf::from(format!("/sys/class/drm/card{i}"));
|
||||
let vendor_file = card_dir.join("device/vendor");
|
||||
if let Some(mut reader) = get_reader(&vendor_file) {
|
||||
let mut buf = String::new();
|
||||
|
|
|
@ -157,7 +157,7 @@ fn main() -> Result<()> {
|
|||
}
|
||||
|
||||
let provider = gtk::CssProvider::new();
|
||||
provider.load_from_resource(&format!("{}/style.css", RESOURCES_BASE_PATH));
|
||||
provider.load_from_resource(&format!("{RESOURCES_BASE_PATH}/style.css"));
|
||||
if let Some(display) = gdk::Display::default() {
|
||||
gtk::style_context_add_provider_for_display(
|
||||
&display,
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn is_openxr_ready() -> bool {
|
|||
|
||||
let Ok(xr_instance) = entry.create_instance(
|
||||
&xr::ApplicationInfo {
|
||||
application_name: &format!("{}-openxr-prober", CMD_NAME),
|
||||
application_name: &format!("{CMD_NAME}-openxr-prober"),
|
||||
application_version: 0,
|
||||
engine_name: CMD_NAME,
|
||||
engine_version: 0,
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn lighthouse_profile() -> Profile {
|
|||
environment.insert("LD_LIBRARY_PATH".into(), prepare_ld_library_path(&prefix));
|
||||
Profile {
|
||||
uuid: "lighthouse-default".into(),
|
||||
name: format!("Lighthouse Driver - {name} Default", name = APP_NAME),
|
||||
name: format!("Lighthouse Driver - {APP_NAME} Default"),
|
||||
xrservice_path: data_monado_path(),
|
||||
xrservice_type: XRServiceType::Monado,
|
||||
ovr_comp: ProfileOvrCompatibilityModule {
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn openhmd_profile() -> Profile {
|
|||
environment.insert("LD_LIBRARY_PATH".into(), prepare_ld_library_path(&prefix));
|
||||
Profile {
|
||||
uuid: "openhmd-default".into(),
|
||||
name: format!("OpenHMD - {name} Default", name = APP_NAME),
|
||||
name: format!("OpenHMD - {APP_NAME} Default"),
|
||||
xrservice_path: data_monado_path(),
|
||||
xrservice_type: XRServiceType::Monado,
|
||||
ovr_comp: ProfileOvrCompatibilityModule {
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn simulated_profile() -> Profile {
|
|||
);
|
||||
Profile {
|
||||
uuid: "simulated-default".into(),
|
||||
name: format!("Simulated Driver - {name} Default", name = APP_NAME),
|
||||
name: format!("Simulated Driver - {APP_NAME} Default"),
|
||||
xrservice_path: data_monado_path(),
|
||||
xrservice_type: XRServiceType::Monado,
|
||||
ovr_comp: ProfileOvrCompatibilityModule {
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn survive_profile() -> Profile {
|
|||
environment.insert("LD_LIBRARY_PATH".into(), prepare_ld_library_path(&prefix));
|
||||
Profile {
|
||||
uuid: "survive-default".into(),
|
||||
name: format!("Survive - {name} Default", name = APP_NAME),
|
||||
name: format!("Survive - {APP_NAME} Default"),
|
||||
xrservice_path: data_monado_path(),
|
||||
xrservice_type: XRServiceType::Monado,
|
||||
ovr_comp: ProfileOvrCompatibilityModule {
|
||||
|
|
|
@ -19,7 +19,7 @@ pub fn wivrn_profile() -> Profile {
|
|||
environment.insert("U_PACING_APP_USE_MIN_FRAME_PERIOD".into(), "1".into());
|
||||
Profile {
|
||||
uuid: "wivrn-default".into(),
|
||||
name: format!("WiVRn - {name} Default", name = APP_NAME),
|
||||
name: format!("WiVRn - {APP_NAME} Default"),
|
||||
xrservice_path: data_wivrn_path(),
|
||||
xrservice_type: XRServiceType::Wivrn,
|
||||
ovr_comp: ProfileOvrCompatibilityModule {
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn wmr_profile() -> Profile {
|
|||
environment.insert("LD_LIBRARY_PATH".into(), prepare_ld_library_path(&prefix));
|
||||
Profile {
|
||||
uuid: "wmr-default".into(),
|
||||
name: format!("WMR - {name} Default", name = APP_NAME),
|
||||
name: format!("WMR - {APP_NAME} Default"),
|
||||
xrservice_path: data_monado_path(),
|
||||
xrservice_type: XRServiceType::Monado,
|
||||
ovr_comp: ProfileOvrCompatibilityModule {
|
||||
|
|
|
@ -680,7 +680,7 @@ impl AsyncComponent for App {
|
|||
self.build_window
|
||||
.sender()
|
||||
.emit(BuildWindowMsg::UpdateBuildStatus(BuildStatus::Error(
|
||||
format!("Exit status {}", errcode),
|
||||
format!("Exit status {errcode}"),
|
||||
)));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -93,7 +93,7 @@ impl SimpleComponent for BuildWindow {
|
|||
BuildStatus::Building => String::default(),
|
||||
BuildStatus::Done => "Build done, you can close this window".into(),
|
||||
BuildStatus::Error(code) => {
|
||||
format!("Build failed: \"{c}\"", c = code)
|
||||
format!("Build failed: \"{code}\"")
|
||||
}
|
||||
}.as_str(),
|
||||
#[track = "model.changed(BuildWindow::build_status())"]
|
||||
|
|
|
@ -213,7 +213,7 @@ pub fn file_row<F: Fn(Option<String>) + 'static + Clone>(
|
|||
|
||||
let filedialog = gtk::FileDialog::builder()
|
||||
.modal(true)
|
||||
.title(format!("Select {}", title))
|
||||
.title(format!("Select {title}"))
|
||||
.build();
|
||||
|
||||
row.connect_activated(clone!(
|
||||
|
@ -255,7 +255,7 @@ pub fn path_row<F: Fn(Option<String>) + 'static + Clone>(
|
|||
let (row, path_label) = filedialog_row_base(title, description, value, cb.clone());
|
||||
let filedialog = gtk::FileDialog::builder()
|
||||
.modal(true)
|
||||
.title(format!("Select Path for {}", title))
|
||||
.title(format!("Select Path for {title}"))
|
||||
.build();
|
||||
|
||||
row.connect_activated(clone!(
|
||||
|
|
|
@ -45,8 +45,7 @@ impl SimpleComponent for SteamLaunchOptionsBox {
|
|||
add_css_class: "dim-label",
|
||||
set_hexpand: true,
|
||||
set_label: format!(
|
||||
"Set this string in the launch options of Steam games, so that they can pick up the {app} runtime correctly",
|
||||
app = APP_NAME)
|
||||
"Set this string in the launch options of Steam games, so that they can pick up the {APP_NAME} runtime correctly")
|
||||
.as_str(),
|
||||
set_xalign: 0.0,
|
||||
set_wrap: true,
|
||||
|
|
|
@ -112,7 +112,7 @@ impl AsyncComponent for WivrnWiredStartBox {
|
|||
Self::Input::UpdateSelectedProfile(p) => self.set_selected_profile(p),
|
||||
Self::Input::StartWivrnClient => {
|
||||
if !dep_adb().check() {
|
||||
alert("ADB is not installed", Some(&format!("Please install ADB on your computer to start the WiVRn client from {}.", APP_NAME)), Some(&self.root_win));
|
||||
alert("ADB is not installed", Some(&format!("Please install ADB on your computer to start the WiVRn client from {APP_NAME}.")), Some(&self.root_win));
|
||||
return;
|
||||
}
|
||||
self.set_start_client_status(StartClientStatus::InProgress);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue