Skip to content

Commit 3869610

Browse files
Merge pull request #480 from ijackson/async
Hide and deprecate AsyncConfigBuilder
2 parents c3d6a4a + c494cd8 commit 3869610

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

src/builder.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,18 @@ pub struct DefaultState {
103103
sources: Vec<Box<dyn Source + Send + Sync>>,
104104
}
105105

106-
/// The asynchronous configuration builder.
107-
///
108-
/// Similar to a [`ConfigBuilder`] it maintains a set of defaults, a set of sources, and overrides.
109-
///
110-
/// Defaults do not override anything, sources override defaults, and overrides override anything else.
111-
/// Within those three groups order of adding them at call site matters - entities added later take precedence.
112-
///
113-
/// For more detailed description and examples see [`ConfigBuilder`].
114-
/// [`AsyncConfigBuilder`] is just an extension of it that takes async functions into account.
115-
///
116-
/// To obtain a [`Config`] call [`build`](AsyncConfigBuilder::build) or [`build_cloned`](AsyncConfigBuilder::build_cloned)
117-
///
118-
/// # Example
119-
/// Since this library does not implement any [`AsyncSource`] an example in rustdocs cannot be given.
120-
/// Detailed explanation about why such a source is not implemented is in [`AsyncSource`]'s documentation.
121-
///
122-
/// Refer to [`ConfigBuilder`] for similar API sample usage or to the examples folder of the crate, where such a source is implemented.
106+
// Dummy useless struct
107+
//
108+
// This struct exists only to avoid the semver break
109+
// which would be implied by removing it.
110+
//
111+
// This struct cannot be used for anything useful.
112+
// (Nor can it be extended without a semver break, either.)
113+
//
114+
// In a future release, we should have
115+
// type AsyncConfigBuilder = ConfigBuilder<AsyncState>;
116+
#[deprecated = "AsyncConfigBuilder is useless. Use ConfigBuilder<AsyncState>"]
117+
#[doc(hidden)]
123118
#[derive(Debug, Clone, Default)]
124119
pub struct AsyncConfigBuilder {}
125120

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod ser;
3333
mod source;
3434
mod value;
3535

36-
pub use crate::builder::{AsyncConfigBuilder, ConfigBuilder};
36+
pub use crate::builder::ConfigBuilder;
3737
pub use crate::config::Config;
3838
pub use crate::env::Environment;
3939
pub use crate::error::ConfigError;
@@ -46,6 +46,9 @@ pub use crate::source::AsyncSource;
4646
pub use crate::source::Source;
4747
pub use crate::value::{Value, ValueKind};
4848

49+
#[allow(deprecated)]
50+
pub use crate::builder::AsyncConfigBuilder;
51+
4952
// Re-export
5053
#[cfg(feature = "convert-case")]
5154
pub use convert_case::Case;

0 commit comments

Comments
 (0)