Merge branch 'option' into 'main'

config: Be consistent about Option

Closes #488

See merge request tpo/core/arti!582
This commit is contained in:
eta 2022-06-13 12:30:03 +00:00
commit f7a9274e57
3 changed files with 7 additions and 1 deletions

1
crates/arti/semver.md Normal file
View File

@ -0,0 +1 @@
BREAKING: LoggingConfig.journald now takes `Option<Into<String>>`

View File

@ -34,7 +34,7 @@ pub struct LoggingConfig {
///
/// Only takes effect if Arti is built with the `journald` filter.
#[builder(
setter(into, strip_option),
setter(into),
field(build = r#"tor_config::resolve_option(&self.journald, || None)"#)
)]
journald: Option<String>,

View File

@ -153,9 +153,14 @@ impl Reconfigure {
///
/// See <https://gitlab.torproject.org/tpo/core/arti/-/issues/488>
///
/// For consistency with other APIs in Arti, when using this,
/// do not pass `setter(strip_option)` to derive_builder.
///
/// # ⚠ Stability Warning ⚠
///
/// We hope to significantly change this so that it is an method in an extension trait.
/// We may also make it able to support settings where the special "no such thing" value is
/// not `T::Default`.
//
// This is an annoying AOI right now because you have to write things like
// #[builder(field(build = r#"tor_config::resolve_option(&self.dns_port, || None)"#))]