Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed May 2, 2024
1 parent efceb38 commit 7593d5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/src/altrep.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ implementation adopt this caching strategy (more specifically, an ALTREP object
has two slots, `data1` and `data2`, and `data2` is usually used for the cache).

But, don't worry. `try_from_altrep_mut()` has a second argument,
`invalidate_cache`. You can set this to `true` to invalidate the cache.
`invalidate_cache`. You can set this to `true` to clear the cache.

```rust
#[savvy]
fn tweak_altint2(mut x: IntegerSexp) -> savvy::Result<()> {
if let Ok(x) = MyAltInt::try_from_altrep_mut(&mut x, false) {
if let Ok(x) = MyAltInt::try_from_altrep_mut(&mut x, true) {
// ^^^^^
// changed!
```
Expand Down

0 comments on commit 7593d5c

Please sign in to comment.