rwf2 / multer

An async parser for multipart/form-data content-type in Rust
MIT License
156 stars 35 forks source link

refactor!: Replace 'r lifetime with 'static #49

Closed jaysonsantos closed 1 year ago

jaysonsantos commented 1 year ago

Hey there, first of all, thank you for this project! While checking the library and doing some implementation, I saw that it was "hard" to carry around a multipart (taking a look on the viability of using it on warp). So, this change would make that a stream is bound to 'static, correct me if I am wrong but, usually that is the case, right? Do you see an use where that would not be true? Let me know if this change makes sense or not. Thanks in advance!

jaysonsantos commented 1 year ago

Another option there if a reference is needed, I could try to make an Owned version of it, wdyt?

jaysonsantos commented 1 year ago

Having second thoughts here, I just checked rocket's implementation and this change would break the API of multer I will just close the pr but still, fell free to comment if an owned version makes sense.

SergioBenitez commented 1 year ago

That's right - you want the lifetime! You can always alias the type with a 'static.