Skip to content

Commit

Permalink
🎨 cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodjooy committed Dec 1, 2024
1 parent 60003ca commit 87ee1b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ impl From<plugin_version::Checked> for ReleaseVersion {
.description(description)
.platform(Plugin)
.previous_mandatory_version(Version::new(
major as _,
minor as _,
security as _,
))


major as _,
minor as _,
security as _,
))
.add_download_source(
DownloadSourceItem::builder()
.name("CRX")
Expand Down Expand Up @@ -119,16 +117,16 @@ impl From<app_version::Checked> for ReleaseVersion {
apk,
spare_apk,
baidu,
baidu_text,..
baidu_text,
..
}: app_version::Checked,
) -> Self {
ReleaseVersion::builder()
// 经过校验的version,没有问题
.version(version.parse().unwrap_or_log())
.previous_mandatory_version(
last_force_version.parse().unwrap_or_log(),
)

last_force_version.parse().unwrap_or_log(),
)
.platform(Pocket)
.description(description)
.add_download_source(
Expand Down Expand Up @@ -175,16 +173,16 @@ impl From<desktop_version::Checked> for ReleaseVersion {
dmg,
spare_dmg,
baidu,
baidu_text,..
baidu_text,
..
}: desktop_version::Checked,
) -> Self {
ReleaseVersion::builder()
// 经过校验的version,没有问题
.version(version.parse().unwrap_or_log())
.previous_mandatory_version(
last_force_version.parse().unwrap_or_log(),
)

last_force_version.parse().unwrap_or_log(),
)
.platform(Desktop)
.description(description)
.add_download_source(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder;

use crate::ceobe::operation::version::models::{
download_source::DownloadSourceItem,
platform::ReleasePlatform,
download_source::DownloadSourceItem, platform::ReleasePlatform,
};

#[derive(Debug, Serialize, Deserialize, Clone, TypedBuilder, PartialEq)]
Expand Down Expand Up @@ -56,9 +55,7 @@ mod test {
fn test_version_serde() {
let ver = ReleaseVersion::builder()
.version(Version::new(1, 13, 2))
.previous_mandatory_version(
Version::new(1, 0, 0)
)
.previous_mandatory_version(Version::new(1, 0, 0))
.description("Abc")
.platform(ReleasePlatform::Desktop)
.add_download_source(
Expand Down Expand Up @@ -88,9 +85,9 @@ mod test {
.name("百度云备用")
.build(),
)

.build(),
).deleted(false)
)
.deleted(false)
.build();

let serde =
Expand Down

0 comments on commit 87ee1b2

Please sign in to comment.