Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Jul 14, 2022
1 parent 0aa1fbc commit 174aca6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions cmd/airdrop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,18 @@ async fn main() -> Result<()> {
//just skip empty line
continue;
}
if record.len() < 2 {
println!("[WARN] invalid record: line {}, {:?}, skip.", idx, record);
continue;
} else if record.len() > 2 {
println!(
"[WARN] invalid record: line {}, {:?}, ignore extra field.",
idx, record
);
match record.len().cmp(&2) {
std::cmp::Ordering::Equal => {}
std::cmp::Ordering::Greater => {
println!(
"[WARN] invalid record: line {}, {:?}, ignore extra field.",
idx, record
);
}
std::cmp::Ordering::Less => {
println!("[WARN] invalid record: line {}, {:?}, skip.", idx, record);
continue;
}
}
let address = match AccountAddress::from_str(record[0].trim()) {
Ok(address) => address,
Expand Down

0 comments on commit 174aca6

Please sign in to comment.