yufuquant / rust-bybit

Rust API connector for Bybit's WebSockets APIs.
MIT License
35 stars 10 forks source link

refactor: be more permissive in function inputs #7

Closed EricCrosson closed 2 years ago

EricCrosson commented 2 years ago

Do not require the caller to pass owned strings, since a reference will suffice.

EricCrosson commented 2 years ago

I'm still new to Rust, so I hope this is somewhat idiomatic and definitely useful, but I'm very open to feedback!

If this does turn out to be a desirable change I am happy to update the linear/spot files to match.

jukanntenn commented 2 years ago

Actually I also new to rust. I checked rust docs about AsRef<T>, it seems an appropriate usage here. Feel free to make the changes.

EricCrosson commented 2 years ago

Sounds good @jukanntenn, I've updated all uses of &Vec<String>