http icon indicating copy to clipboard operation
http copied to clipboard

simplified code

Open wandercn opened this issue 1 year ago • 1 comments

remove generic T

wandercn avatar Apr 09 '24 07:04 wandercn

This is a breaking change and I don't think it is going to be accepted, although I'm not the maintainer of the project.

Alternatively, you could add a default type to the T parameter, which is a non-breaking change, but in that case, the default parameter wouldn't be able to be &str because that would require a lifetime parameter, and String wouldn't be appropriate as the default type for many use cases either due to a performance reason.

So, what is your motivation behind the change? If you just don't want to write type parameters in your code, you can define a type alias like type Port = http::uri::Port<String>; in your code.

tesaguri avatar Apr 09 '24 10:04 tesaguri

Yea, this is breaking, we cannot do this. I'm going to close, but if you have a problem you're trying to solve, you can open a discussion and say more 👍

seanmonstar avatar Dec 17 '24 11:12 seanmonstar