Skip to content

Commit b192f7c

Browse files
refactor(host): reword feature methods
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
1 parent 81d77b2 commit b192f7c

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

crates/host/src/wasmbus/experimental.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ impl Features {
1717
pub fn new() -> Self {
1818
Self::default()
1919
}
20+
2021
/// Enable the built-in HTTP server capability provider
21-
pub fn with_builtin_http(mut self) -> Self {
22+
pub fn enable_builtin_http(mut self) -> Self {
2223
self.builtin_http = true;
2324
self
2425
}
2526

2627
/// Enable the built-in NATS messaging capability provider
27-
pub fn with_builtin_messaging(mut self) -> Self {
28+
pub fn enable_builtin_messaging(mut self) -> Self {
2829
self.builtin_messaging = true;
2930
self
3031
}
@@ -55,8 +56,8 @@ impl std::iter::Sum for Features {
5556
impl From<&str> for Features {
5657
fn from(s: &str) -> Self {
5758
match &*s.to_ascii_lowercase() {
58-
"builtin-http" | "builtin_http" => Self::new().with_builtin_http(),
59-
"builtin-messaging" | "builtin_messaging" => Self::new().with_builtin_messaging(),
59+
"builtin-http" | "builtin_http" => Self::new().enable_builtin_http(),
60+
"builtin-messaging" | "builtin_messaging" => Self::new().enable_builtin_messaging(),
6061
_ => {
6162
warn!(%s, "unknown feature flag");
6263
Self::new()

crates/host/src/wasmbus/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ pub mod config;
7171
/// wasmCloud host configuration
7272
pub mod host_config;
7373

74+
pub use self::experimental::Features;
7475
pub use self::host_config::Host as HostConfig;
7576

7677
use self::config::{BundleGenerator, ConfigBundle};
77-
pub use self::experimental::Features;
7878
use self::handler::Handler;
7979

8080
const MAX_INVOCATION_CHANNEL_SIZE: usize = 5000;

crates/test-util/src/host.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ impl WasmCloudTestHost {
101101
provider_shutdown_delay: Some(Duration::from_millis(300)),
102102
allow_file_load: true,
103103
secrets_topic_prefix,
104-
experimental_features: Features::new().with_builtin_http().with_builtin_messaging(),
104+
experimental_features: Features::new()
105+
.enable_builtin_http()
106+
.enable_builtin_messaging(),
105107
..Default::default()
106108
};
107109
if let Some(psc) = policy_service_config {

0 commit comments

Comments
 (0)