mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
refactor: simplify AddPackageSignerParams merge field from Option<bool> to bool
This commit is contained in:
@@ -59,8 +59,7 @@ pub struct AddPackageSignerParams {
|
|||||||
#[ts(type = "string | null")]
|
#[ts(type = "string | null")]
|
||||||
pub versions: Option<VersionRange>,
|
pub versions: Option<VersionRange>,
|
||||||
#[arg(long, help = "help.arg.merge")]
|
#[arg(long, help = "help.arg.merge")]
|
||||||
#[ts(optional)]
|
pub merge: bool,
|
||||||
pub merge: Option<bool>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn add_package_signer(
|
pub async fn add_package_signer(
|
||||||
@@ -89,7 +88,7 @@ pub async fn add_package_signer(
|
|||||||
.as_authorized_mut()
|
.as_authorized_mut()
|
||||||
.upsert(&signer, || Ok(VersionRange::None))?
|
.upsert(&signer, || Ok(VersionRange::None))?
|
||||||
.mutate(|existing| {
|
.mutate(|existing| {
|
||||||
*existing = if merge.unwrap_or(false) {
|
*existing = if merge {
|
||||||
VersionRange::or(existing.clone(), versions)
|
VersionRange::or(existing.clone(), versions)
|
||||||
} else {
|
} else {
|
||||||
versions
|
versions
|
||||||
|
|||||||
Reference in New Issue
Block a user