From 13c6ea3e138d46a11e64e4667a8b9ec7770c506d Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Thu, 6 Jun 2024 15:17:39 -0700 Subject: [PATCH 1/2] chore: changes from formatting on save --- src/main.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 637ba86..96ce07d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,8 @@ mod area_capture; mod config_management; mod ffmpeg_interface; mod timer; -mod wayland_record; mod utils; +mod wayland_record; use ffmpeg_interface::Ffmpeg; use gettextrs::{bindtextdomain, gettext, setlocale, textdomain, LocaleCategory}; @@ -15,19 +15,17 @@ use gtk::glib; use gtk::prelude::*; use gtk::{ AboutDialog, Application, Builder, Button, CheckButton, ComboBoxText, CssProvider, Entry, - FileChooserAction, FileChooserNative, Image, Label, SpinButton, - ToggleButton, Window, + FileChooserAction, FileChooserNative, Image, Label, SpinButton, ToggleButton, Window, }; -use utils::is_wayland; use std::cell::RefCell; use std::ops::Add; use std::path::Path; use std::process::{Command, Stdio}; use std::rc::Rc; use timer::{recording_delay, start_timer, stop_timer}; +use utils::is_wayland; use wayland_record::WaylandRecorder; - #[async_std::main] async fn main() { // Create new application @@ -107,7 +105,7 @@ pub fn build_ui(application: &Application) { main_window.set_title(Some(&gettext("Blue Recorder"))); main_window.set_application(Some(application)); area_chooser_window.set_title(Some(&gettext("Area Chooser"))); // Title is hidden - + // disable interaction with main window // main_window.set_can_focus(false); // main_window.set_can_target(false); @@ -284,7 +282,7 @@ pub fn build_ui(application: &Application) { area_grab_icon.set_from_file(Some(area_icon_path)); screen_grab_icon.set_from_file(Some(screen_icon_path)); - window_grab_icon.set_from_file(Some(&window_icon_path)); + window_grab_icon.set_from_file(Some(&window_icon_path)); } // any theme _ => { @@ -339,7 +337,7 @@ pub fn build_ui(application: &Application) { area_grab_icon.set_from_file(Some(area_icon_path)); screen_grab_icon.set_from_file(Some(screen_icon_path)); - window_grab_icon.set_from_file(Some(&window_icon_path)); + window_grab_icon.set_from_file(Some(&window_icon_path)); } } // Labels From 57fab3a92761ec0430ee82db1889812ed2ceb919 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Thu, 6 Jun 2024 15:18:41 -0700 Subject: [PATCH 2/2] refactor: remove redundant references --- src/config_management.rs | 2 +- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config_management.rs b/src/config_management.rs index bc81d18..65b7649 100755 --- a/src/config_management.rs +++ b/src/config_management.rs @@ -81,7 +81,7 @@ pub fn get(selection: &str, key: &str) -> String { .join("blue-recorder") .join("config.ini"); String::from( - Ini::load_from_file(&config_path) + Ini::load_from_file(config_path) .unwrap() .with_section(Some(selection)) .get(key) diff --git a/src/main.rs b/src/main.rs index 96ce07d..7d737a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -144,12 +144,12 @@ pub fn build_ui(application: &Application) { // Get audio sources let sources_descriptions: Vec = { let list_sources_child = Command::new("pactl") - .args(&["list", "sources"]) + .args(["list", "sources"]) .stdout(Stdio::piped()) .spawn(); let sources_descriptions = String::from_utf8(if let Ok(..) = list_sources_child { Command::new("grep") - .args(&["-e", "device.description"]) + .args(["-e", "device.description"]) .stdin(list_sources_child.unwrap().stdout.take().unwrap()) .output() .unwrap()