Skip to content

Commit

Permalink
tree: Format and indent files
Browse files Browse the repository at this point in the history
Format and indent files changed in the last few commits in a separate
commit to avoid diff noise.
  • Loading branch information
arun-mani-j committed Dec 19, 2024
1 parent 6d6fdd4 commit 446c033
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 25 deletions.
5 changes: 4 additions & 1 deletion backend-demo/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use ashpd::{
request::RequestImpl,
settings::{SettingsImpl, SettingsSignalEmitter},
},
desktop::{settings::{ColorScheme, Namespace, APPEARANCE_NAMESPACE, COLOR_SCHEME_KEY}, HandleToken},
desktop::{
settings::{ColorScheme, Namespace, APPEARANCE_NAMESPACE, COLOR_SCHEME_KEY},
HandleToken,
},
zbus::zvariant::OwnedValue,
PortalError,
};
Expand Down
9 changes: 7 additions & 2 deletions src/backend/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ impl AccountInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.get_user_information(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), options)
.await
imp.get_user_information(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
options,
)
.await
},
)
.await
Expand Down
10 changes: 8 additions & 2 deletions src/backend/app_chooser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,14 @@ impl AppChooserInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.choose_application(HandleToken::try_from(&handle).unwrap(), app_id.inner(), parent_window.inner(), choices, options)
.await
imp.choose_application(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
parent_window.inner(),
choices,
options,
)
.await
},
)
.await
Expand Down
13 changes: 10 additions & 3 deletions src/backend/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ pub trait BackgroundSignalEmitter: Send + Sync {
pub trait BackgroundImpl: RequestImpl {
async fn get_app_state(&self) -> Result<HashMap<AppID, AppState>, PortalError>;

async fn notify_background(&self, token: HandleToken, app_id: AppID, name: &str)
-> Result<Background, PortalError>;
async fn notify_background(
&self,
token: HandleToken,
app_id: AppID,
name: &str,
) -> Result<Background, PortalError>;

async fn enable_autostart(
&self,
Expand Down Expand Up @@ -130,7 +134,10 @@ impl BackgroundInterface {
&self.cnx,
handle.clone(),
Arc::clone(&self.imp),
async move { imp.notify_background(HandleToken::try_from(&handle).unwrap(), app_id, &name).await },
async move {
imp.notify_background(HandleToken::try_from(&handle).unwrap(), app_id, &name)
.await
},
)
.await
}
Expand Down
9 changes: 7 additions & 2 deletions src/backend/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ impl EmailInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.compose(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), options)
.await
imp.compose(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
options,
)
.await
},
)
.await
Expand Down
30 changes: 24 additions & 6 deletions src/backend/file_chooser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,14 @@ impl FileChooserInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.open_file(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), &title, options)
.await
imp.open_file(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
&title,
options,
)
.await
},
)
.await
Expand All @@ -274,8 +280,14 @@ impl FileChooserInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.save_file(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), &title, options)
.await
imp.save_file(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
&title,
options,
)
.await
},
)
.await
Expand All @@ -298,8 +310,14 @@ impl FileChooserInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.save_files(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), &title, options)
.await
imp.save_files(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
&title,
options,
)
.await
},
)
.await
Expand Down
22 changes: 17 additions & 5 deletions src/backend/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use crate::{
request::{Request, RequestImpl},
MaybeAppID, MaybeWindowIdentifier, Result,
},
desktop::{request::Response, screenshot::Screenshot as ScreenshotResponse, Color, HandleToken},
desktop::{
request::Response, screenshot::Screenshot as ScreenshotResponse, Color, HandleToken,
},
zvariant::{DeserializeDict, OwnedObjectPath, Type},
AppID, WindowIdentifierType,
};
Expand Down Expand Up @@ -92,8 +94,13 @@ impl ScreenshotInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.screenshot(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), options)
.await
imp.screenshot(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
options,
)
.await
},
)
.await
Expand All @@ -116,8 +123,13 @@ impl ScreenshotInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.pick_color(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), options)
.await
imp.pick_color(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
options,
)
.await
},
)
.await
Expand Down
9 changes: 8 additions & 1 deletion src/backend/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ impl SecretInterface {
&self.cnx,
handle.clone(),
Arc::clone(&self.imp),
async move { imp.retrieve(HandleToken::try_from(&handle).unwrap(), app_id, std::os::fd::OwnedFd::from(fd)).await },
async move {
imp.retrieve(
HandleToken::try_from(&handle).unwrap(),
app_id,
std::os::fd::OwnedFd::from(fd),
)
.await
},
)
.await
}
Expand Down
10 changes: 8 additions & 2 deletions src/backend/wallpaper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ impl WallpaperInterface {
handle.clone(),
Arc::clone(&self.imp),
async move {
imp.with_uri(HandleToken::try_from(&handle).unwrap(), app_id.inner(), window_identifier.inner(), uri, options)
.await
imp.with_uri(
HandleToken::try_from(&handle).unwrap(),
app_id.inner(),
window_identifier.inner(),
uri,
options,
)
.await
},
)
.await
Expand Down
5 changes: 4 additions & 1 deletion src/desktop/handle_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use std::{

use rand::{distributions::Alphanumeric, thread_rng, Rng};
use serde::{Deserialize, Serialize};
use zbus::{names::OwnedMemberName, zvariant::{OwnedObjectPath, Type}};
use zbus::{
names::OwnedMemberName,
zvariant::{OwnedObjectPath, Type},
};

/// A handle token is a DBus Object Path element, specified in the
/// [`Request`](crate::desktop::Request) or
Expand Down

0 comments on commit 446c033

Please sign in to comment.