style(lib): use rust 2018 edition idioms (#1910)
This commit is contained in:
@@ -57,13 +57,13 @@ impl Exec {
|
||||
struct TokioSpawnError;
|
||||
|
||||
impl fmt::Debug for TokioSpawnError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt("tokio::spawn failed (is a tokio runtime running this future?)", f)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for TokioSpawnError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt("tokio::spawn failed (is a tokio runtime running this future?)", f)
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ impl Exec {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Exec {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Exec")
|
||||
.finish()
|
||||
}
|
||||
|
||||
@@ -129,8 +129,7 @@ mod tests {
|
||||
use super::Rewind;
|
||||
/*
|
||||
use super::*;
|
||||
extern crate tokio_mockstream;
|
||||
use self::tokio_mockstream::MockStream;
|
||||
use tokio_mockstream::MockStream;
|
||||
use std::io::Cursor;
|
||||
|
||||
// Test a partial rewind
|
||||
|
||||
@@ -9,7 +9,7 @@ use std::fmt;
|
||||
pub enum Never {}
|
||||
|
||||
impl fmt::Display for Never {
|
||||
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use super::Never;
|
||||
/// A function to help "yield" a future, such that it is re-scheduled immediately.
|
||||
///
|
||||
/// Useful for spin counts, so a future doesn't hog too much time.
|
||||
pub(crate) fn yield_now(cx: &mut Context) -> Poll<Never> {
|
||||
pub(crate) fn yield_now(cx: &mut Context<'_>) -> Poll<Never> {
|
||||
cx.waker().wake_by_ref();
|
||||
Poll::Pending
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user