mmmmib
November 23, 2018, 12:27am
2
You could have two "proxy" crates, that both depend on num-algo
and reexport it, but specify different features in their Cargo.toml
s. See also this thread:
You would probably have to have two separate proxy crates to handle old/new logins and a way to either detect which to use, or try the other on failure of the first.
So your dep tree would look something like:
[your crate]
|
|-> [argonrs_old]
| |
| |-> [argonrs v1]
|
|-> [argonrs_new]
|
|-> [argonrs v2]
then you could call the functions as
assert!(num::abs(cpu_proxy_crate::num_algo::foo(42) - pu_proxy_crate::num_algo::foo(42)) < 0.0000001 );
1 Like