From 44d4d658465676e8f2d1f23c282e385a44444f67 Mon Sep 17 00:00:00 2001 From: Shovit Date: Mon, 9 Oct 2023 13:42:25 +0545 Subject: [PATCH] feat(rust): use `random_name` function at `NodeManagerDefaults` struct --- .../rust/ockam/ockam_api/src/nodes/service/in_memory_node.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/implementations/rust/ockam/ockam_api/src/nodes/service/in_memory_node.rs b/implementations/rust/ockam/ockam_api/src/nodes/service/in_memory_node.rs index 539be1c4698..9264865a190 100644 --- a/implementations/rust/ockam/ockam_api/src/nodes/service/in_memory_node.rs +++ b/implementations/rust/ockam/ockam_api/src/nodes/service/in_memory_node.rs @@ -2,12 +2,11 @@ use miette::IntoDiagnostic; use std::ops::Deref; use std::path::PathBuf; -use rand::random; - use ockam::{Context, Result, TcpTransport}; use ockam_core::compat::{string::String, sync::Arc}; use ockam_transport_tcp::TcpListenerOptions; +use crate::cli_state::random_name; use crate::cli_state::{add_project_info_to_node_state, init_node_state, CliState}; use crate::cloud::Controller; use crate::config::cli::TrustContextConfig; @@ -175,7 +174,7 @@ pub struct NodeManagerDefaults { impl Default for NodeManagerDefaults { fn default() -> Self { Self { - node_name: hex::encode(random::<[u8; 4]>()), + node_name: random_name(), tcp_listener_address: "127.0.0.1:0".to_string(), } }