Skip to content

Commit

Permalink
Make get_id more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Hukadan committed Mar 27, 2023
1 parent 0e91aac commit eb764f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "pobsd-parser"
description = "Simplistic parser for the PlayOnBSD Database"
authors = ["Hukadan <me@hukadan.org>"]
version = "0.3.0"
version = "0.3.1"
edition = "2021"
homepage = "https://github.com/playonbsd-rs/pobsd-parser"
documentation = "https://docs.rs/pobsd-parser"
Expand Down
7 changes: 4 additions & 3 deletions src/store_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ impl StoreLink {
let re = Regex::new(r"https://store.steampowered.com/app/(\d+)(/?.+)?").unwrap();
match &self.store {
Store::Steam => {
let cap = re.captures(&self.url).unwrap();
if let Some(cap) = cap.get(1) {
return cap.as_str().parse::<usize>().ok();
if let Some(cap) = re.captures(&self.url) {
if let Some(cap) = cap.get(1) {
return cap.as_str().parse::<usize>().ok();
};
};
None
}
Expand Down

0 comments on commit eb764f6

Please sign in to comment.