Skip to content

Commit

Permalink
Make private module more clearly private
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 13, 2022
1 parent 1442e27 commit c81dc67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions impl/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn impl_struct(input: Struct) -> TokenStream {
let source_method = source_body.map(|body| {
quote! {
fn source(&self) -> std::option::Option<&(dyn std::error::Error + 'static)> {
use thiserror::private::AsDynError;
use thiserror::__private::AsDynError;
#body
}
}
Expand Down Expand Up @@ -84,7 +84,7 @@ fn impl_struct(input: Struct) -> TokenStream {
}
};
quote! {
use thiserror::private::AsDynError;
use thiserror::__private::AsDynError;
#combinator
}
} else if type_is_option(backtrace_field.ty) {
Expand Down Expand Up @@ -115,7 +115,7 @@ fn impl_struct(input: Struct) -> TokenStream {
let use_as_display = if display.has_bonus_display {
Some(quote! {
#[allow(unused_imports)]
use thiserror::private::{DisplayAsDisplay, PathAsDisplay};
use thiserror::__private::{DisplayAsDisplay, PathAsDisplay};
})
} else {
None
Expand Down Expand Up @@ -226,7 +226,7 @@ fn impl_enum(input: Enum) -> TokenStream {
});
Some(quote! {
fn source(&self) -> std::option::Option<&(dyn std::error::Error + 'static)> {
use thiserror::private::AsDynError;
use thiserror::__private::AsDynError;
#[allow(deprecated)]
match self {
#(#arms)*
Expand Down Expand Up @@ -271,7 +271,7 @@ fn impl_enum(input: Enum) -> TokenStream {
#source: #varsource,
..
} => {
use thiserror::private::AsDynError;
use thiserror::__private::AsDynError;
#combinator
}
}
Expand All @@ -292,7 +292,7 @@ fn impl_enum(input: Enum) -> TokenStream {
};
quote! {
#ty::#ident {#backtrace: #varsource, ..} => {
use thiserror::private::AsDynError;
use thiserror::__private::AsDynError;
#source_backtrace
}
}
Expand Down Expand Up @@ -335,7 +335,7 @@ fn impl_enum(input: Enum) -> TokenStream {
}) {
Some(quote! {
#[allow(unused_imports)]
use thiserror::private::{DisplayAsDisplay, PathAsDisplay};
use thiserror::__private::{DisplayAsDisplay, PathAsDisplay};
})
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pub use thiserror_impl::*;

// Not public API.
#[doc(hidden)]
pub mod private {
pub mod __private {
pub use crate::aserror::AsDynError;
pub use crate::display::{DisplayAsDisplay, PathAsDisplay};
}

0 comments on commit c81dc67

Please sign in to comment.