Skip to content

Commit a0e7ba2

Browse files
author
Deren Vural
committed
trunk formatting
Signed-off-by: Deren Vural <[email protected]>
1 parent b0e5b39 commit a0e7ba2

File tree

5 files changed

+48
-45
lines changed

5 files changed

+48
-45
lines changed

.github/workflows/rust.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@ name: Rust CI
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [main]
99
paths-ignore:
10-
- '**.md'
10+
- "**.md"
1111
pull_request:
12-
branches: [ main ]
12+
branches: [main]
1313
paths-ignore:
14-
- '**.md'
14+
- "**.md"
1515

1616
env:
1717
CARGO_TERM_COLOR: always
1818
RUST_TOOLCHAIN: nightly
1919
TOOLCHAIN_PROFILE: minimal
2020
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2121

22-
2322
jobs:
2423
lints:
2524
name: Run cargo fmt and cargo clippy

src/mainwindow/imp.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ use gtk::{
2828
subclass::prelude::*, Button, CompositeTemplate, PolicyType, ScrolledWindow, Stack,
2929
TemplateChild,
3030
};
31-
use std::{
32-
cell::Cell, cell::RefCell, cell::RefMut, rc::Rc
33-
};
31+
use std::{cell::Cell, cell::RefCell, cell::RefMut, rc::Rc};
3432

3533
// Modules
3634
use crate::{

src/provider/mod.rs

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ mod imp;
2222

2323
// Imports
2424
use adwaita::{gio, glib};
25-
use gio::{Settings, Cancellable};
25+
use gio::{Cancellable, Settings};
2626
use glib::Object;
2727
use gtk::{prelude::*, subclass::prelude::*};
2828
use std::ffi::OsStr;
2929

3030
// Crates
31-
use crate::{processor::Processor, property::Property, subprocess::subprocess::exec_communicate_async, APP_ID};
31+
use crate::{
32+
processor::Processor, property::Property, subprocess::subprocess::exec_communicate_async,
33+
APP_ID,
34+
};
3235

3336
// GObject wrapper for Provider
3437
glib::wrapper! {
@@ -312,40 +315,43 @@ impl Provider {
312315
//control.push_current();
313316

314317
// Start cancellable async process
315-
match exec_communicate_async(&[OsStr::new("nvidia-settings")], None::<&Cancellable>/*Some(&control)*/, |result| {
316-
// Callback
317-
match result {
318-
Err(err) => {
319-
println!(
320-
"Process failed with error: `{}`",
321-
err.to_string()
322-
);
323-
}
324-
Ok(buffers) => match buffers {
325-
// Success
326-
(Some(_), None) | (None, None) => {
327-
println!("Nvidia Settings now closed..");
318+
match exec_communicate_async(
319+
&[OsStr::new("nvidia-settings")],
320+
None::<&Cancellable>, /*Some(&control)*/
321+
|result| {
322+
// Callback
323+
match result {
324+
Err(err) => {
325+
println!("Process failed with error: `{}`", err.to_string());
326+
}
327+
Ok(buffers) => match buffers {
328+
// Success
329+
(Some(_), None) | (None, None) => {
330+
println!("Nvidia Settings now closed..");
328331

329-
// Get settings for APP_ID
330-
let settings = Settings::new(APP_ID);
332+
// Get settings for APP_ID
333+
let settings = Settings::new(APP_ID);
331334

332-
// Update settings
333-
let name: &str = "nvidia-settings-open";
334-
match settings.set_boolean(name, false){
335-
Ok(_) => println!("..Setting `{}` updated!", name),
336-
Err(err) => panic!("..Cannot update `{}` setting: `{}`", name, err),
335+
// Update settings
336+
let name: &str = "nvidia-settings-open";
337+
match settings.set_boolean(name, false) {
338+
Ok(_) => println!("..Setting `{}` updated!", name),
339+
Err(err) => {
340+
panic!("..Cannot update `{}` setting: `{}`", name, err)
341+
}
342+
}
337343
}
338-
}
339-
// Error
340-
(None, Some(stderr_buffer)) | (Some(_), Some(stderr_buffer)) => {
341-
println!(
342-
"Process failed with error: `{}`",
343-
String::from_utf8_lossy(&stderr_buffer)
344-
);
345-
}
346-
},
347-
}
348-
}) {
344+
// Error
345+
(None, Some(stderr_buffer)) | (Some(_), Some(stderr_buffer)) => {
346+
println!(
347+
"Process failed with error: `{}`",
348+
String::from_utf8_lossy(&stderr_buffer)
349+
);
350+
}
351+
},
352+
}
353+
},
354+
) {
349355
Ok(()) => return Ok(()),
350356
Err(err) => return Err(err.to_string()),
351357
};

src/subprocess/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub mod subprocess {
125125
argv: &[&OsStr],
126126
cancellable: Option<&impl IsA<gio::Cancellable>>,
127127
// Callback? that way could modify settings....
128-
callback: Q //dyn FnOnce(Result<(Option<glib::Bytes>, Option<glib::Bytes>), glib::Error>) + 'static
128+
callback: Q, //dyn FnOnce(Result<(Option<glib::Bytes>, Option<glib::Bytes>), glib::Error>) + 'static
129129
) -> Result<(), glib::Error> {
130130
// Create subprocess
131131
match gio::Subprocess::newv(argv, gio::SubprocessFlags::STDOUT_PIPE) {

style.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spinbutton {
1010
}
1111

1212
grid#statistic_item_grid {
13-
outline-style: solid;
14-
outline-width: 1px;
15-
border-radius: 3px;
13+
outline-style: solid;
14+
outline-width: 1px;
15+
border-radius: 3px;
1616
}

0 commit comments

Comments
 (0)