mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-08-23 19:32:29 +02:00
feat(updater): add Builder::default_version_comparator (#1919)
This commit is contained in:
@@ -93,12 +93,13 @@ impl RemoteRelease {
|
||||
}
|
||||
|
||||
pub type OnBeforeExit = Arc<dyn Fn() + Send + Sync + 'static>;
|
||||
pub type VersionComparator = Arc<dyn Fn(Version, RemoteRelease) -> bool + Send + Sync>;
|
||||
|
||||
pub struct UpdaterBuilder {
|
||||
app_name: String,
|
||||
current_version: Version,
|
||||
config: Config,
|
||||
version_comparator: Option<Box<dyn Fn(Version, RemoteRelease) -> bool + Send + Sync>>,
|
||||
pub(crate) version_comparator: Option<VersionComparator>,
|
||||
executable_path: Option<PathBuf>,
|
||||
target: Option<String>,
|
||||
endpoints: Option<Vec<Url>>,
|
||||
@@ -139,7 +140,7 @@ impl UpdaterBuilder {
|
||||
mut self,
|
||||
f: F,
|
||||
) -> Self {
|
||||
self.version_comparator = Some(Box::new(f));
|
||||
self.version_comparator = Some(Arc::new(f));
|
||||
self
|
||||
}
|
||||
|
||||
@@ -283,7 +284,7 @@ pub struct Updater {
|
||||
config: Config,
|
||||
app_name: String,
|
||||
current_version: Version,
|
||||
version_comparator: Option<Box<dyn Fn(Version, RemoteRelease) -> bool + Send + Sync>>,
|
||||
version_comparator: Option<VersionComparator>,
|
||||
timeout: Option<Duration>,
|
||||
proxy: Option<Url>,
|
||||
endpoints: Vec<Url>,
|
||||
|
||||
Reference in New Issue
Block a user