mirror of
https://github.com/OMGeeky/confique.git
synced 2026-01-06 11:39:37 +01:00
Fix derive macro for pub(crate) visibility
This commit is contained in:
@@ -333,6 +333,11 @@ fn inner_visibility(outer: &syn::Visibility) -> TokenStream {
|
||||
// The inherited one is relative to the parent module.
|
||||
syn::Visibility::Inherited => quote! { pub(super) },
|
||||
|
||||
// For `pub(crate)`
|
||||
syn::Visibility::Restricted(r) if r.path.is_ident("crate") && r.in_token.is_none() => {
|
||||
quote! { pub(crate) }
|
||||
},
|
||||
|
||||
// If the path in the `pub(in <path>)` visibility is absolute, we can
|
||||
// use it like that as well.
|
||||
syn::Visibility::Restricted(r) if r.path.leading_colon.is_some() => quote! { outer },
|
||||
|
||||
@@ -90,7 +90,7 @@ pub trait Partial: for<'de> Deserialize<'de> {
|
||||
fn with_fallback(self, fallback: Self) -> Self;
|
||||
}
|
||||
|
||||
/// A source of configuration values for the configuration object `T`, e.g. a
|
||||
/// A source of configuration values for the configuration object `C`, e.g. a
|
||||
/// file or environment variables.
|
||||
pub trait Source<C: Config> {
|
||||
/// Attempts to load a potentially partially configuration object.
|
||||
|
||||
Reference in New Issue
Block a user