Skip to content

1.0.5

Compare
Choose a tag to compare
@dtolnay dtolnay released this 10 Nov 02:46
· 443 commits to master since this release
1.0.5
10b8e58
  • Support interpolating Path and PathBuf fields as if they had a Display impl

    use std::io;
    use std::path::PathBuf;
    use thiserror::Error;
    
    #[derive(Error, Debug)]
    pub enum Error {
        #[error("failed to load {1}")]
        Read(#[source] io::Error, PathBuf),
    }

    In previous releases this would fail to compile with:

    error[E0277]: `std::path::PathBuf` doesn't implement `std::fmt::Display`
     --> src/main.rs:7:13
      |
    7 |     #[error("failed to load {1}")]
      |             ^^^^^^^^^^^^^^^^^^^^ `std::path::PathBuf` cannot be formatted with the default formatter