Skip to content

Commit

Permalink
Standardize on 'Error, Debug' derive order
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 7, 2024
1 parent 2096b11 commit 42b1460
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/test_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ fn test_macro_rules() {

macro_rules! decl_error {
($variant:ident($value:ident)) => {
#[derive(Debug, Error)]
#[derive(Error, Debug)]
pub enum Error0 {
#[error("{0:?}")]
$variant($value),
}

#[derive(Debug, Error)]
#[derive(Error, Debug)]
#[error("{0:?}")]
pub enum Error1 {
$variant($value),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn test_unused_qualifications() {
// std::error::Error is already imported in the caller's scope so it must
// suppress unused_qualifications.

#[derive(Debug, Error)]
#[derive(Error, Debug)]
#[error("...")]
pub struct MyError;

Expand All @@ -24,7 +24,7 @@ fn test_needless_lifetimes() {
#![allow(dead_code)]
#![deny(clippy::needless_lifetimes)]

#[derive(Debug, Error)]
#[derive(Error, Debug)]
#[error("...")]
pub enum MyError<'a> {
A(#[from] std::io::Error),
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/from-not-source.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use thiserror::Error;

#[derive(Debug, Error)]
#[derive(Error, Debug)]
pub struct Error {
#[source]
source: std::io::Error,
Expand Down

0 comments on commit 42b1460

Please sign in to comment.