Skip to content

Commit 6db8cd9

Browse files
committed
rust: fix for 2021 edition
1 parent a015024 commit 6db8cd9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ same file or directory:
1010
# use std::error::Error;
1111
use same_file::is_same_file;
1212
13-
# fn try_main() -> Result<(), Box<Error>> {
13+
# fn try_main() -> Result<(), Box<dyn Error>> {
1414
assert!(is_same_file("/bin/sh", "/usr/bin/sh")?);
1515
# Ok(())
1616
# }
@@ -31,7 +31,7 @@ might look like this:
3131
# use std::error::Error;
3232
use same_file::Handle;
3333
34-
# fn try_main() -> Result<(), Box<Error>> {
34+
# fn try_main() -> Result<(), Box<dyn Error>> {
3535
let candidates = &[
3636
"examples/is_same_file.rs",
3737
"examples/is_stderr.rs",
@@ -131,7 +131,7 @@ impl Handle {
131131
/// # use std::error::Error;
132132
/// use same_file::Handle;
133133
///
134-
/// # fn try_main() -> Result<(), Box<Error>> {
134+
/// # fn try_main() -> Result<(), Box<dyn Error>> {
135135
/// let source = Handle::from_path("./source")?;
136136
/// let target = Handle::from_path("./target")?;
137137
/// assert_ne!(source, target, "The files are the same.");
@@ -163,7 +163,7 @@ impl Handle {
163163
/// # use std::fs::File;
164164
/// use same_file::Handle;
165165
///
166-
/// # fn try_main() -> Result<(), Box<Error>> {
166+
/// # fn try_main() -> Result<(), Box<dyn Error>> {
167167
/// let source = File::open("./source")?;
168168
/// let target = File::open("./target")?;
169169
///
@@ -197,7 +197,7 @@ impl Handle {
197197
/// # use std::error::Error;
198198
/// use same_file::Handle;
199199
///
200-
/// # fn try_main() -> Result<(), Box<Error>> {
200+
/// # fn try_main() -> Result<(), Box<dyn Error>> {
201201
/// let stdin = Handle::stdin()?;
202202
/// let stdout = Handle::stdout()?;
203203
/// let stderr = Handle::stderr()?;
@@ -294,7 +294,7 @@ impl Handle {
294294
/// use std::fs::File;
295295
/// use same_file::Handle;
296296
///
297-
/// # fn try_main() -> Result<(), Box<Error>> {
297+
/// # fn try_main() -> Result<(), Box<dyn Error>> {
298298
/// let source = File::open("source")?;
299299
/// let target = File::create("target")?;
300300
///
@@ -386,12 +386,12 @@ mod tests {
386386

387387
use super::is_same_file;
388388

389-
type Result<T> = result::Result<T, Box<error::Error + Send + Sync>>;
389+
type Result<T> = result::Result<T, Box<dyn error::Error + Send + Sync>>;
390390

391391
/// Create an error from a format!-like syntax.
392392
macro_rules! err {
393393
($($tt:tt)*) => {
394-
Box::<error::Error + Send + Sync>::from(format!($($tt)*))
394+
Box::<dyn error::Error + Send + Sync>::from(format!($($tt)*))
395395
}
396396
}
397397

0 commit comments

Comments
 (0)