Parameters shouldn't be owned by command
Should this signature:
fn hello_mul(_: &Context, args: Vec<String>) -> RedisResult {
become:
fn hello_mul(_: &'ae Context, args: &'a [&'a str]) -> RedisResult {
Right now, to convert the params into Rust's String requires to_string() which allocates. Also, it's semantically more correct.
@unrealhoang Thanks for opening the issue. This is indeed something that needs careful consideration; we’ll take a look to see what the best solution would be.
The function should probably be generic and accept any type that implements IntoIterator<Item=&str>?
@unrealhoang @tamird I've been looking into this for a bit. We currently use create owned strings from the arguments that Redis handles to us. It might be a good idea to use references instead, and then pass those on to the command functions. This is a bit of a large change; I'll update when there will be progress.
@gavrie This can be probably closed after #157 has been merged and we use Vec<RedisString> for the args.