Skip to content

Commit 2fdda08

Browse files
committed
reformat
1 parent f7c10ea commit 2fdda08

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

plugins/updater/src/updater.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,26 @@ pub struct RemoteRelease {
102102

103103
impl RemoteRelease {
104104
/// The release's download URL for the given target.
105-
pub fn download_url(&self, fallback_target: &str, installer: Option<Installer>) -> Result<&Url> {
106-
let target = installer.map(|installer| format!("{fallback_target}-{}", installer.suffix())).unwrap_or("".to_string());
105+
pub fn download_url(
106+
&self,
107+
fallback_target: &str,
108+
installer: Option<Installer>,
109+
) -> Result<&Url> {
110+
let target = installer
111+
.map(|installer| format!("{fallback_target}-{}", installer.suffix()))
112+
.unwrap_or("".to_string());
107113
match self.data {
108114
RemoteReleaseInner::Dynamic(ref platform) => Ok(&platform.url),
109115
RemoteReleaseInner::Static { ref platforms } => platforms.get(&target).map_or_else(
110-
|| platforms.get(fallback_target).map_or(
111-
Err(Error::TargetsNotFound(target.to_string(), fallback_target.to_string())),
116+
|| {
117+
platforms.get(fallback_target).map_or(
118+
Err(Error::TargetsNotFound(
119+
target.to_string(),
120+
fallback_target.to_string(),
121+
)),
112122
|p| Ok(&p.url),
113-
),
123+
)
124+
},
114125
|p| Ok(&p.url),
115126
),
116127
}

0 commit comments

Comments
 (0)