`compile_error!` when attempting to use `redis_store` feature
jqnatividad opened this issue · comments
First off, thanks @jaemk and @omid for adding Redis support!
So I just changed my cargo.toml cached entry from:
cached = "0.30"
to
cached = { version = "0.32", features = ["redis_store"] }
However, I'm getting the following error when I run cargo build
:
tokio-comp or async-std-comp features required for aio feature
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:109:13
|
109 | compile_error!("tokio-comp or async-std-comp features required for aio feature")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: tokio-comp or async-std-comp features required for aio feature
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:870:9
|
870 | compile_error!("tokio-comp or async-std-comp features required for aio feature");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: use of undeclared type `ValueCodec`
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:179:9
|
179 | ValueCodec::default()
| ^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use crate::parser::ValueCodec;
|
error[E0433]: failed to resolve: use of undeclared type `ValueCodec`
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:191:9
|
191 | ValueCodec::default()
| ^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use crate::parser::ValueCodec;
|
error[E0433]: failed to resolve: use of undeclared type `ValueCodec`
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:220:9
|
220 | ValueCodec::default()
| ^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use crate::parser::ValueCodec;
|
error[E0433]: failed to resolve: use of undeclared type `ValueCodec`
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:229:9
|
229 | ValueCodec::default()
| ^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use crate::parser::ValueCodec;
|
error[E0433]: failed to resolve: use of undeclared type `ValueCodec`
--> /home/jqnatividad/.cargo/registry/src/github.com-1ecc6299db9ec823/redis-0.21.5/src/aio.rs:872:21
|
872 | let codec = ValueCodec::default()
| ^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use crate::parser::ValueCodec;
|
looking at the redis
dependency:
Lines 70 to 73 in 68f6619
It pulls in aio
which triggers the compile_error!
woops, forgot to move that redis feature to be only included with the async features. I'll fix it this morning
released the fix in 0.32.1
also added a non-async redis example
Line 5 in 74b3b0c
to test it works when async features aren't enabled
Thanks for the quick turnaround! Caching with Redis is working like a dream!
The example allowed me to quickly adapt my project to use it.
https://github.com/jqnatividad/qsv/blob/master/src/cmd/fetch.rs#L15