Skip to content

Commit

Permalink
Fix config rexport (#1436)
Browse files Browse the repository at this point in the history
* Fix config rexport

* Remove unstable_config rexports

* Rename unstable_config features to internal_config
  • Loading branch information
Mallets authored Sep 18, 2024
1 parent adc50a9 commit 91d823d
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 19 deletions.
16 changes: 13 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions commons/zenoh-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub fn unstable(attr: TokenStream, tokens: TokenStream) -> TokenStream {

// FIXME(fuzzypixelz): refactor `unstable` macro to accept arguments
#[proc_macro_attribute]
pub fn unstable_config(args: TokenStream, tokens: TokenStream) -> TokenStream {
pub fn internal_config(args: TokenStream, tokens: TokenStream) -> TokenStream {
let tokens = unstable_doc(args, tokens);
let mut item = match parse_annotable_item!(tokens) {
Ok(item) => item,
Expand All @@ -195,7 +195,7 @@ pub fn unstable_config(args: TokenStream, tokens: TokenStream) -> TokenStream {
Err(err) => return err.into_compile_error().into(),
};

let feature_gate: Attribute = parse_quote!(#[cfg(feature = "unstable_config")]);
let feature_gate: Attribute = parse_quote!(#[cfg(feature = "internal_config")]);
attrs.push(feature_gate);

TokenStream::from(item.to_token_stream())
Expand Down
4 changes: 2 additions & 2 deletions zenoh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ transport_udp = ["zenoh-transport/transport_udp"]
transport_unixsock-stream = ["zenoh-transport/transport_unixsock-stream"]
transport_ws = ["zenoh-transport/transport_ws"]
transport_vsock = ["zenoh-transport/transport_vsock"]
unstable = ["unstable_config", "zenoh-keyexpr/unstable"]
unstable_config = []
unstable = ["internal_config", "zenoh-keyexpr/unstable"]
internal_config = []

[dependencies]
tokio = { workspace = true, features = ["rt", "macros", "time"] }
Expand Down
4 changes: 2 additions & 2 deletions zenoh/src/api/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Config {
}
}

#[zenoh_macros::unstable_config]
#[zenoh_macros::internal_config]
impl std::ops::Deref for Config {
type Target = zenoh_config::Config;

Expand All @@ -100,7 +100,7 @@ impl std::ops::Deref for Config {
}
}

#[zenoh_macros::unstable_config]
#[zenoh_macros::internal_config]
impl std::ops::DerefMut for Config {
fn deref_mut(&mut self) -> &mut <Self as std::ops::Deref>::Target {
&mut self.0
Expand Down
2 changes: 1 addition & 1 deletion zenoh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub mod time {

/// Configuration to pass to [`open`] and [`scout`] functions and associated constants
pub mod config {
pub use zenoh_config::{WhatAmI, WhatAmIMatcher};
pub use zenoh_config::{EndPoint, Locator, WhatAmI, WhatAmIMatcher, ZenohId};

pub use crate::api::config::Config;
#[zenoh_macros::unstable]
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/acl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]
#![cfg(target_family = "unix")]
mod test {
use std::{
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]

mod test {
use std::{
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/connection_retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]

use zenoh::{Config, Wait};
use zenoh_config::{ConnectionRetryConf, EndPoint, ModeDependent};
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]

use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/interceptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]
#![cfg(unix)]

use std::{
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/open_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]
#![allow(unused)]
use std::{
future::IntoFuture,
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]

use std::{
sync::{
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]

use std::{
sync::{
Expand Down
2 changes: 1 addition & 1 deletion zenoh/tests/unicity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

#![cfg(feature = "unstable_config")]
#![cfg(feature = "internal_config")]

use std::{
sync::{
Expand Down

0 comments on commit 91d823d

Please sign in to comment.