Skip to content

Commit b739e29

Browse files
committed
Swap strip_prefix with trim_start_matchesand use .parse instead of Version::parse
1 parent a4bb45a commit b739e29

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/update.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ pub async fn update(http_client: reqwest::Client) {
4444
}
4545
};
4646

47-
let latest_tag = latest_release
47+
let latest_version = latest_release
4848
.tag_name
49-
.strip_prefix('v')
50-
.unwrap_or(&latest_release.tag_name);
49+
.trim_start_matches('v')
50+
.parse::<Version>();
5151

52-
let latest_version = match Version::parse(latest_tag) {
52+
let latest_version = match latest_version {
5353
Ok(value) => value,
5454
Err(err) => {
5555
error!("Failed to parse version of latest release: {}", err);

0 commit comments

Comments
 (0)