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
ravenclaw900 committed Jul 27, 2023
1 parent 2982636 commit 3ad6f77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
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.19.0"
tungstenite = "0.19.0"
Expand Down
17 changes: 9 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
use hyper::{Body, Request, Response};
use std::task::{Context, Poll};
use std::pin::Pin;
use pin_project::pin_project;
use pin_project_lite::pin_project;

use tungstenite::{Error, error::ProtocolError};
use tungstenite::handshake::derive_accept_key;
Expand All @@ -117,13 +117,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! {
/// 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 3ad6f77

Please sign in to comment.