Skip to content

Commit

Permalink
changed README example to use "...".parse()
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPeel committed Apr 12, 2023
1 parent 105009b commit 8ce6043
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ iban = "1"
...
```

Construct a `Iban` type by using `Iban::parse` or `FromStr::from_str`.
Construct a `Iban` type by using `str::parse`, `FromStr::from_str`, or `Iban::parse`.

```rust
use iban::Iban;
let iban: Iban = Iban::parse("AA110011123Z5678")
let iban: Iban = "AA110011123Z5678"
.parse()
.unwrap_or_else(|err| {
// This example panics, but you should handle the error cases properly.
panic!("invalid iban: {err}");
Expand Down

0 comments on commit 8ce6043

Please sign in to comment.