imbolc / tower-cookies

A tower (axum) cookies manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only partial re-export of `cookie` types?

ilyvion opened this issue · comments

So I noticed that there are some pub use cookie::<Whatever>s in tower-cookies, but it only covers some of the types. Like if you try to do

use tower_cookies::{Cookie, Cookies};

Cookie::build(...)
    .same_site(SameSite::Lax)

you are told

error[E0433]: failed to resolve: use of undeclared type `SameSite`
   --> path/to/file.rs:103:24
    |
103 |             .same_site(SameSite::Lax)
    |                        ^^^^^^^^ use of undeclared type `SameSite`

and there's no SameSite to import from tower_cookies. Obviously I could just add a dependency on cookie and import it from there, but I feel like this library would be less confusing if it either exported all of cookie (or at least the parts that are part of the cookie creation API) or none of cookie; exporting only parts makes the API surface only partially accessible "by default."

Thanks, that makes sense, would you provide a PR?

I'll see what I can do. 😄👍

Er, which option do you prefer? Exporting "everything" or nothing?

Maybe we leave current reexports as they are to avoid api breaking and just add pub use cookie? What do you think?

That seems decent enough, yeah. 👍

It's published, thank you 🙏