ProjectLighthouseCAU / lighthouse-rust

Rust SDK for Project Lighthouse
https://docs.rs/lighthouse-client
MIT License
2 stars 1 forks source link

Make path parameters more generic #15

Open fwcd opened 1 month ago

fwcd commented 1 month ago

Instead of taking &[&str], this refactors most path parameters to take impl Iterator<Item = impl AsRef<str>>. This should make it possible to pass owned containers (e.g. Vecs or arrays), including those containing owned Strings.

While this seems to be the suggested approach for passing strings generically, it significantly impairs readability and introduces some ambiguities when passing empty paths (previously &[] would have been accepted, which is now ambiguous due to the generic impl AsRef<str>).

Draft PR for now until we figure out a more acceptable tradeoff.