biomunky / newsapi

An API for interacting with the News API
MIT License
7 stars 2 forks source link

Explore product types when building URLs #6

Open lotia opened 5 years ago

lotia commented 5 years ago

Looking at https://github.com/biomunky/newsapi/blob/a74dc5afe90a076effbbaabc1585d37851cfc6ea/src/newsapi/newsapi.rs#L34 and similar and wondering if we can use a product type (usefully rather than for the sake of the types) so we can keep params in the mix as type and then convert all at once?

Using as inspiration and clarificaion of product types in Rust https://manishearth.github.io/blog/2017/03/04/what-are-sum-product-and-pi-types/

So use a struct in some way?

biomunky commented 5 years ago

I had a quick look, it is more complex than I initially expected when we discussed on Telegram.