Skip to content

Commit

Permalink
add example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Raz-Hemo committed Mar 3, 2024
1 parent 7f23082 commit 8d3cb4e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ fn keyed(a: String) -> Option<usize> {

----

```compile_fail
use cached::proc_macro::cached;
/// Cannot use sync_writes and result_fallback together
#[cached(
result = true,
time = 1,
sync_writes = true,
result_fallback = true
)]
fn doesnt_compile() -> Result<String, ()> {
Ok("a".to_string())
}
```
----

```rust,no_run,ignore
use cached::proc_macro::io_cached;
use cached::AsyncRedisCache;
Expand Down

0 comments on commit 8d3cb4e

Please sign in to comment.