Skip to content

Commit

Permalink
Merge pull request #27 from oxydev/change-panic-to-return
Browse files Browse the repository at this point in the history
change panic to return
  • Loading branch information
SaberDoTcodeR authored May 6, 2021
2 parents 44a7a07 + cf142de commit 80adaba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,10 @@ pub mod subscrypt {
provider_address: AccountId,
plan_index: u128,
) -> bool {
let user = match self.username_to_address.get(&username) {
Some(name) => *name,
None => panic!("this username is invalid!"),
};
self.check_subscription(user, provider_address, plan_index)
match self.username_to_address.get(&username) {
Some(name) => self.check_subscription(*name, provider_address, plan_index),
None => false,
}
}

fn retrieve_whole_data(&self, caller: AccountId) -> Vec<SubscriptionRecord> {
Expand Down

0 comments on commit 80adaba

Please sign in to comment.