cargo fix --all

* it added "dyn" to trait objects
* it changed "..." in patterns to "..="

cargo --version says: "cargo 1.37.0-nightly (545f35425 2019-05-23)"
This commit is contained in:
Scott Lamb
2019-06-14 08:47:11 -07:00
parent 7dd98bb76a
commit 7fe9d34655
22 changed files with 83 additions and 83 deletions

View File

@@ -56,7 +56,7 @@ pub trait Clocks : Send + Sync + 'static {
timeout: StdDuration) -> Result<T, mpsc::RecvTimeoutError>;
}
pub fn retry_forever<C, T, E>(clocks: &C, f: &mut FnMut() -> Result<T, E>) -> T
pub fn retry_forever<C, T, E>(clocks: &C, f: &mut dyn FnMut() -> Result<T, E>) -> T
where C: Clocks, E: Into<Error> {
loop {
let e = match f() {

View File

@@ -47,7 +47,7 @@ impl Error {
}
impl Fail for Error {
fn cause(&self) -> Option<&Fail> {
fn cause(&self) -> Option<&dyn Fail> {
self.inner.cause()
}

View File

@@ -44,8 +44,8 @@ pub fn hex(raw: &[u8]) -> String {
/// Returns [0, 16) or error.
fn dehex_byte(hex_byte: u8) -> Result<u8, ()> {
match hex_byte {
b'0' ... b'9' => Ok(hex_byte - b'0'),
b'a' ... b'f' => Ok(hex_byte - b'a' + 10),
b'0' ..= b'9' => Ok(hex_byte - b'0'),
b'a' ..= b'f' => Ok(hex_byte - b'a' + 10),
_ => Err(()),
}
}