snapview / tungstenite-rs

Lightweight stream-based WebSocket implementation for Rust.
Apache License 2.0
1.79k stars 208 forks source link

Remove or make even more optional the `url` crate in the next version. #412

Closed Thomas-airmatrix closed 1 month ago

Thomas-airmatrix commented 4 months ago

Outside of tests there is only a single use of url::Url in tungstenite:

impl<'a> IntoClientRequest for &'a Url {
    fn into_client_request(self) -> Result<Request> {
        self.as_str().into_client_request()
    }
}

impl IntoClientRequest for Url {
    fn into_client_request(self) -> Result<Request> {
        self.as_str().into_client_request()
    }
}

Which is just implementing some helper conversion traits.

Instead, we can just have users call as_str() on the Url directly if needed.

With http =1, http::uri::Uri has replaced most uses of the url crate. I have multiple project such that the only use of url is tungstenite.

Its-Just-Nans commented 1 month ago

This can be closed ?! (#419)