Skip to content

Commit 6c24b9b

Browse files
Legend-MasterKokoro2336
authored andcommitted
Clean up
1 parent cecfcf1 commit 6c24b9b

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

plugins/recent-doc/src/commands.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,9 @@ pub(crate) fn add_recent_document<R: Runtime>(app: AppHandle<R>, _path: &str) ->
8383
controller.noteNewRecentDocumentURL(&ns_path);
8484
}
8585

86-
// CRITICAL FIX: Ensure this doesn't run on macOS
8786
#[cfg(all(unix, not(target_os = "macos")))]
8887
{
89-
Err(crate::error::Error::UnsupportedPlatform(
90-
"Recent documents are not supported on Unix-like systems.".to_string(),
91-
))?;
88+
Err(crate::error::Error::UnsupportedPlatform)?;
9289
}
9390

9491
Ok(())
@@ -122,9 +119,7 @@ pub(crate) fn clear_recent_documents<R: Runtime>(_app: AppHandle<R>) -> Result<(
122119

123120
#[cfg(all(unix, not(target_os = "macos")))]
124121
{
125-
Err(crate::error::Error::UnsupportedPlatform(
126-
"Recent documents are not supported on Unix-like systems.".to_string(),
127-
))?;
122+
Err(crate::error::Error::UnsupportedPlatform)?;
128123
}
129124

130125
Ok(())
@@ -184,9 +179,7 @@ pub(crate) fn get_recent_documents<R: Runtime>(_app: AppHandle<R>) -> Result<Vec
184179

185180
#[cfg(all(unix, not(target_os = "macos")))]
186181
{
187-
Err(crate::error::Error::UnsupportedPlatform(
188-
"Recent documents are not supported on Unix-like systems.".to_string(),
189-
))?;
182+
Err(crate::error::Error::UnsupportedPlatform)?;
190183
}
191184

192185
Ok(recent_docs)

plugins/recent-doc/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ pub type Result<T> = std::result::Result<T, Error>;
99
#[derive(Debug, thiserror::Error)]
1010
#[allow(unused)]
1111
pub enum Error {
12-
#[error("Unsupported platform: {0}")]
13-
UnsupportedPlatform(String),
12+
#[error("API not supported on the current platform")]
13+
UnsupportedPlatform,
1414
#[error("Invalid path: {0}")]
1515
InvalidPath(String),
1616
// Transform windows error into our error type

0 commit comments

Comments
 (0)