Skip to content

Commit

Permalink
Clean up warnings/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
djc authored and Ralith committed Sep 3, 2020
1 parent 35db51e commit f212256
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions quinn/examples/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ async fn run(options: Opt) -> Result<()> {
bail!("root path does not exist");
}

let mut incoming = {
let (endpoint, incoming) = endpoint.bind(&options.listen)?;
info!("listening on {}", endpoint.local_addr()?);
incoming
};
let (endpoint, mut incoming) = endpoint.bind(&options.listen)?;
info!("listening on {}", endpoint.local_addr()?);
drop(endpoint);

while let Some(conn) = incoming.next().await {
info!("connection incoming");
Expand Down
2 changes: 1 addition & 1 deletion quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ where
S: proto::crypto::Session,
{
type Output = ();
fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
let conn = &mut *self.0.lock().unwrap();

let span = info_span!("drive", id = conn.handle.0);
Expand Down
4 changes: 2 additions & 2 deletions quinn/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ where
S: proto::crypto::Session + 'static,
{
type Output = Result<(), io::Error>;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
let endpoint = &mut *self.0.lock().unwrap();
if endpoint.driver.is_none() {
endpoint.driver = Some(cx.waker().clone());
Expand Down Expand Up @@ -410,7 +410,7 @@ where
S: proto::crypto::Session,
{
type Item = Connecting<S>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
let endpoint = &mut *self.0.lock().unwrap();
if endpoint.driver_lost {
Poll::Ready(None)
Expand Down

0 comments on commit f212256

Please sign in to comment.