Skip to content

Commit

Permalink
Merge pull request #461 from lucatrv/fix_readme
Browse files Browse the repository at this point in the history
docs: fix README links to helper functions
  • Loading branch information
tafia authored Sep 16, 2024
2 parents 003620b + 410842e commit 247c080
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ fn example() -> Result<(), Error> {
}
```

Calamine provides helper functions to deal with invalid type values. For instance if you
want to deserialize a column which should contain floats but may also contain invalid values
(i.e. strings), you can use the [`deserialize_as_f64_or_none`] helper function with Serde's
Calamine provides helper functions to deal with invalid type values. For
instance, to deserialize a column which should contain floats but may also
contain invalid values (i.e. strings), you can use the
[`deserialize_as_f64_or_none`](https://docs.rs/calamine/latest/calamine/fn.deserialize_as_f64_or_none.html)
helper function with Serde's
[`deserialize_with`](https://serde.rs/field-attrs.html) field attribute:

```rust
Expand Down Expand Up @@ -81,8 +83,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
```

The [`deserialize_as_f64_or_none`] function will discard all invalid values, if you want to
return them as `String` you can use the [`deserialize_as_f64_or_string`] function instead.
The
[`deserialize_as_f64_or_none`](https://docs.rs/calamine/latest/calamine/fn.deserialize_as_f64_or_none.html)
function discards all invalid values. If instead you would like to return them
as `String`s, you can use the similar
[`deserialize_as_f64_or_string`](https://docs.rs/calamine/latest/calamine/fn.deserialize_as_f64_or_string.html)
function.

### Reader: Simple

Expand Down

0 comments on commit 247c080

Please sign in to comment.