Skip to content

Commit

Permalink
Forgot formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
agg23 committed Jul 21, 2023
1 parent 1d2721e commit cf2f07c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions src/appkit/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
color::Color,
error::Error,
foundation::{id, nil, NSArray, NSInteger, NSMutableDictionary, NSString, Retainable, NSURL},
notification_center::NotificationCenter,
notification_center::NotificationCenter
};

use self::running_application::RunningApplication;
Expand All @@ -24,7 +24,7 @@ pub struct GetFileSystemInfoForPathResponse {
pub writable: bool,
pub unmountable: bool,
pub description: String,
pub file_system_type: String,
pub file_system_type: String
}

impl Workspace {
Expand All @@ -51,7 +51,7 @@ impl Workspace {
/// Maps to `openURL:configuration:completionHandler:`
pub fn open_url_with_completion<F>(&self, _url: &str, _configuration: &str, _completion_handler: F)
where
F: FnOnce() -> (),
F: FnOnce() -> ()
{
unimplemented!("Missing NSWorkspaceOpenConfiguration implementation. Only >=10.15");
}
Expand All @@ -62,9 +62,9 @@ impl Workspace {
_url: &str,
_application_url: &str,
_configuration: &str,
_completion_handler: F,
_completion_handler: F
) where
F: FnOnce() -> (),
F: FnOnce() -> ()
{
unimplemented!("Missing NSWorkspaceOpenConfiguration implementation. Only >=10.15");
}
Expand All @@ -84,7 +84,7 @@ impl Workspace {
/// Launches the app at the specified URL and asynchronously reports back on the app's status.
pub fn open_application_at_url<F>(&self, _application_url: &str, _configuration: &str, _completion_handler: F)
where
F: FnOnce() -> (),
F: FnOnce() -> ()
{
unimplemented!("Missing NSWorkspaceOpenConfiguration implementation. Only >=10.15");
}
Expand All @@ -99,7 +99,7 @@ impl Workspace {
/// Duplicates the specified URLS asynchronously in the same manner as the Finder.
pub fn duplicate_urls<F>(&self, _urls: Vec<&str>, _completion_handler: Option<F>)
where
F: Fn(HashMap<String, String>, Error) -> () + Send + Sync + 'static,
F: Fn(HashMap<String, String>, Error) -> () + Send + Sync + 'static
{
unimplemented!("Missing ability to create NSArrays of NSURL");
// let urls = urls
Expand Down Expand Up @@ -132,7 +132,7 @@ impl Workspace {
/// Moves the specified URLs to the trash in the same manner as the Finder.
pub fn recycle_urls<F>(&self, _urls: Vec<&str>, _completion_handler: Option<F>)
where
F: Fn(HashMap<String, String>, Error) -> () + Send + Sync + 'static,
F: Fn(HashMap<String, String>, Error) -> () + Send + Sync + 'static
{
unimplemented!("Missing ability to create NSArrays of NSURL");
}
Expand Down Expand Up @@ -200,7 +200,7 @@ impl Workspace {
writable: *writable,
unmountable: *unmountable,
description: description.to_string(),
file_system_type: file_system_type.to_string(),
file_system_type: file_system_type.to_string()
})
} else {
None
Expand Down
8 changes: 4 additions & 4 deletions src/appkit/workspace/running_application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use objc_id::Id;

use crate::{
foundation::{id, NSArray, NSInteger, NSString, NSUInteger, Retainable, NSURL},
image::Image,
image::Image
};

#[derive(Debug)]
Expand Down Expand Up @@ -60,7 +60,7 @@ impl RunningApplication {
1 => ApplicationActivationPolicy::Accessory,
2 => ApplicationActivationPolicy::Prohibited,

_ => ApplicationActivationPolicy::Regular,
_ => ApplicationActivationPolicy::Regular
}
}

Expand Down Expand Up @@ -187,7 +187,7 @@ pub enum ApplicationActivationOptions {
ActivateAllWindows = 1 << 0,

/// The application is activated regardless of the currently active app.
ActivateIgnoringOtherApps = 1 << 1,
ActivateIgnoringOtherApps = 1 << 1
}

/// Activation policies (used by `activationPolicy`) that control whether and how an app may be activated.
Expand All @@ -201,5 +201,5 @@ pub enum ApplicationActivationPolicy {
Accessory = 1,

/// The application doesn’t appear in the Dock and may not create windows or be activated.
Prohibited = 2,
Prohibited = 2
}
6 changes: 3 additions & 3 deletions src/foundation/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl NSMutableDictionary {
/// **NOTE:** This only works with string keys
pub fn into_hashmap<T, F>(&self, item_transform: F) -> HashMap<String, T>
where
F: Fn(&String, id) -> T,
F: Fn(&String, id) -> T
{
let mut map = HashMap::new();

Expand Down Expand Up @@ -103,7 +103,7 @@ impl NSMutableDictionary {
next_index: 0,
count: keys.len(),
keys,
dict: self,
dict: self
}
}
}
Expand All @@ -114,7 +114,7 @@ pub struct NSMutableDictionaryIterator<'a> {
count: usize,
keys: Vec<String>,

dict: &'a NSMutableDictionary,
dict: &'a NSMutableDictionary
}

impl Iterator for NSMutableDictionaryIterator<'_> {
Expand Down
6 changes: 3 additions & 3 deletions src/notification_center/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl NotificationCenter {
pub fn observe<F: Fn(Notification) -> () + Send + Sync + 'static>(
&self,
name: Option<NotificationName>,
block: F,
block: F
) -> NotificationObserver {
let block = ConcreteBlock::new(move |ctx| {
let notification = Notification::retain(ctx);
Expand Down Expand Up @@ -92,14 +92,14 @@ impl Retainable for NotificationCenter {
#[derive(Debug)]
pub struct NotificationObserver {
objc: ShareId<Object>,
notification_center: ShareId<Object>,
notification_center: ShareId<Object>
}

impl NotificationObserver {
fn new(observer: id, notification_center: &NotificationCenter) -> Self {
NotificationObserver {
objc: unsafe { ShareId::from_ptr(observer) },
notification_center: notification_center.0.clone(),
notification_center: notification_center.0.clone()
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/notification_center/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ pub enum NotificationName {

/// A custom or unknown NSNotificationName
#[strum(default)]
Custom(String),
Custom(String)
}

impl From<NotificationName> for String {
Expand All @@ -1330,7 +1330,7 @@ impl From<NotificationName> for String {
match name {
// Custom does not have a `*Notification` suffix added
NotificationName::Custom(value) => value,
_ => full_name,
_ => full_name
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/notification_center/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Notification {
(Some(object), None) => unsafe { msg_send![class!(NSNotification), notificationWithName: name object: object] },
(Some(object), Some(user_info)) => unsafe {
msg_send![class!(NSNotification), notificationWithName: name object: object userInfo: user_info]
},
}
};

Notification::retain(id)
Expand Down

0 comments on commit cf2f07c

Please sign in to comment.