From 8d3cb4e3d31b68ab762994a8b61057e119890860 Mon Sep 17 00:00:00 2001 From: Raz-Hemo Date: Sun, 3 Mar 2024 17:19:34 +0200 Subject: [PATCH] add example to readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 3081539..a31fb4a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,22 @@ fn keyed(a: String) -> Option { ---- +```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 { + Ok("a".to_string()) +} +``` +---- + ```rust,no_run,ignore use cached::proc_macro::io_cached; use cached::AsyncRedisCache;