Skip to content

Commit 6d2b8cd

Browse files
author
Deren Vural
committed
trunk formatting
Signed-off-by: Deren Vural <derenv@live.co.uk>
1 parent 366eaea commit 6d2b8cd

File tree

6 files changed

+41
-19
lines changed

6 files changed

+41
-19
lines changed

src/gpu_page/imp.rs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ use adwaita::{gio, glib, prelude::*, ViewStack, ViewSwitcherBar};
2323
use gio::Settings;
2424
use glib::{
2525
once_cell::sync::Lazy, once_cell::sync::OnceCell, subclass::InitializingObject,
26-
subclass::Signal, subclass::SignalType, FromVariant, ParamSpec, ToValue, Value,
27-
translate::FromGlib, SourceId
26+
subclass::Signal, subclass::SignalType, translate::FromGlib, FromVariant, ParamSpec, SourceId,
27+
ToValue, Value,
28+
};
29+
use gtk::{
30+
subclass::prelude::*, Align, CompositeTemplate, Grid, Label, LayoutChild, Orientation,
31+
TemplateChild,
2832
};
29-
use gtk::{subclass::prelude::*, CompositeTemplate, TemplateChild, Label, Grid, Orientation, LayoutChild, Align};
3033
use std::{cell::Cell, cell::RefCell, rc::Rc, sync::Arc, sync::Mutex, sync::MutexGuard};
3134

3235
// Modules
@@ -381,7 +384,12 @@ impl GpuPage {
381384
// !!UNSAFE CODE HERE!!!!UNSAFE CODE HERE!!!!UNSAFE CODE HERE!!!!UNSAFE CODE HERE!!
382385

383386
// Get stored UUID
384-
let uuid: String = self.uuid.clone().get().expect("`uuid` wasn't set properly..").to_string();
387+
let uuid: String = self
388+
.uuid
389+
.clone()
390+
.get()
391+
.expect("`uuid` wasn't set properly..")
392+
.to_string();
385393

386394
// Load refresh time (s) from settings
387395
let refresh_rate: u32 = self.get_setting::<i32>("refreshrate") as u32;
@@ -396,9 +404,13 @@ impl GpuPage {
396404
let uuid_store: Arc<Mutex<String>> = Arc::new(Mutex::new(uuid));
397405

398406
// Create thread safe container for provider
399-
let provider: Option<Provider> = self.provider.clone().get().expect("`provider` wasn't set properly..").to_owned();
400-
let provider_store: Arc<Mutex<Option<Provider>>> =
401-
Arc::new(Mutex::new(provider));
407+
let provider: Option<Provider> = self
408+
.provider
409+
.clone()
410+
.get()
411+
.expect("`provider` wasn't set properly..")
412+
.to_owned();
413+
let provider_store: Arc<Mutex<Option<Provider>>> = Arc::new(Mutex::new(provider));
402414

403415
// Async fill the labels
404416
let id: SourceId = glib::timeout_add_seconds_local(refresh_rate, move || {
@@ -497,7 +509,12 @@ impl GpuPage {
497509
// println!("items saved: `{:?}`", loaded_properties_data); //TEST
498510

499511
// Get stored UUID
500-
let uuid: String = self.uuid.clone().get().expect("`uuid` wasn't set properly..").to_string();
512+
let uuid: String = self
513+
.uuid
514+
.clone()
515+
.get()
516+
.expect("`uuid` wasn't set properly..")
517+
.to_string();
501518

502519
// If present in saved settings, use! otherwise follow below defaults
503520
if let 0 = loaded_properties_data.len() {

src/gpu_page/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use adwaita::{gio, glib, Application, ViewStack};
2626
use gio::Settings;
2727
use glib::{clone, closure, Object};
2828
use gtk::{prelude::*, subclass::prelude::*, Align, Button, Grid, Label, LayoutChild, Orientation};
29-
use std::{cell::RefMut};
29+
use std::cell::RefMut;
3030

3131
// Modules
3232
use crate::{modificationwindow::ModificationWindow, provider::Provider, APP_ID};
@@ -338,7 +338,8 @@ impl GpuPage {
338338
for index in 0..loaded_views.len() {
339339
// println!("VIEW {}", index);
340340
// Grab all saved properties
341-
let properties: Vec<String> = self.imp().check_properties_for_view(&loaded_views[index]);
341+
let properties: Vec<String> =
342+
self.imp().check_properties_for_view(&loaded_views[index]);
342343

343344
// println!("GOT {} PROPERTIES FOR VIEW {}", properties.len(), index);
344345

src/mainwindow/imp.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use adwaita::{gio, glib, prelude::*, subclass::prelude::*};
2222
use gio::Settings;
2323
use glib::{
2424
once_cell::sync::Lazy, once_cell::sync::OnceCell, signal::Inhibit,
25-
subclass::InitializingObject, FromVariant, ParamSpec, Value, subclass::Signal, subclass::SignalType,
25+
subclass::InitializingObject, subclass::Signal, subclass::SignalType, FromVariant, ParamSpec,
26+
Value,
2627
};
2728
use gtk::{
2829
subclass::prelude::*, Button, CompositeTemplate, PolicyType, ScrolledWindow, Stack,

src/mainwindow/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use imp::SettingsWindowContainer;
2424
// Imports
2525
use adwaita::{gio, glib, prelude::*, subclass::prelude::*};
2626
use gio::{Settings, SimpleAction};
27-
use glib::{clone, Object, closure};
27+
use glib::{clone, closure, Object};
2828
use std::cell::RefMut;
2929

3030
// Modules

src/settingswindow/imp.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,13 @@ impl WindowImpl for SettingsWindow {
381381
self.update_setting("app-settings-open", false);
382382

383383
// Emit signal to notify changes made to view (and thus reload required)
384-
let modification_window_container: RefMut<ParentContainer> = self.parent_window.borrow_mut();
385-
let _result = modification_window_container.window.as_ref().unwrap().emit_by_name::<i32>("update-all-views", &[]);
384+
let modification_window_container: RefMut<ParentContainer> =
385+
self.parent_window.borrow_mut();
386+
let _result = modification_window_container
387+
.window
388+
.as_ref()
389+
.unwrap()
390+
.emit_by_name::<i32>("update-all-views", &[]);
386391

387392
// Pass close request on to the parent
388393
self.parent_close_request(window)

src/settingswindow/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ impl SettingsWindow {
7171
* Notes:
7272
*
7373
*/
74-
pub fn new(
75-
app: &adwaita::Application,
76-
parent_window: &MainWindow,
77-
) -> Self {
74+
pub fn new(app: &adwaita::Application, parent_window: &MainWindow) -> Self {
7875
// Create new window
79-
let obj: SettingsWindow = Object::new(&[("application", app)]).expect("`SettingsWindow` should be instantiable.");
76+
let obj: SettingsWindow = Object::new(&[("application", app)])
77+
.expect("`SettingsWindow` should be instantiable.");
8078

8179
// Set custom properties
8280
//

0 commit comments

Comments
 (0)