Skip to content

Commit

Permalink
Replace pin-project with pin-project-lite.
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Jul 31, 2023
1 parent 84a5b99 commit 30effcf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# main
* Replace `pin-project` with `pin-project-lite`.

# v0.11.0 - 2023-07-31
* Update `tungstenite` and `tokio-tungstenite` to `v0.20`.

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2021"

[dependencies]
hyper = { version = "0.14.4" }
pin-project = "1.0.8"
pin-project-lite = "0.2.10"
tokio = "1.2.0"
tokio-tungstenite = "0.20.0"
tungstenite = "0.20.0"
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
use hyper::{Body, Request, Response};
use std::task::{Context, Poll};
use std::pin::Pin;
use pin_project::pin_project;

use tungstenite::{Error, error::ProtocolError};
use tungstenite::handshake::derive_accept_key;
Expand All @@ -117,13 +116,14 @@ pub use tungstenite;

pub use tokio_tungstenite::WebSocketStream;

/// A future that resolves to a websocket stream when the associated HTTP upgrade completes.
#[pin_project]
#[derive(Debug)]
pub struct HyperWebsocket {
#[pin]
inner: hyper::upgrade::OnUpgrade,
config: Option<WebSocketConfig>,
pin_project_lite::pin_project! {
/// A future that resolves to a websocket stream when the associated HTTP upgrade completes.
#[derive(Debug)]
pub struct HyperWebsocket {
#[pin]
inner: hyper::upgrade::OnUpgrade,
config: Option<WebSocketConfig>,
}
}

/// Try to upgrade a received `hyper::Request` to a websocket connection.
Expand Down

0 comments on commit 30effcf

Please sign in to comment.