add experimental action
publish release / release (push) Failing after 3m38s

apply formatting
This commit is contained in:
2026-05-08 22:30:11 +02:00
parent 51b1123cf9
commit d9ade649d3
17 changed files with 242 additions and 143 deletions
+12 -7
View File
@@ -34,24 +34,29 @@ pub async fn get_client(
}
fn generate_random_mcp_server_name() -> String {
use rand::distr::Alphanumeric;
use rand::RngExt;
use rand::distr::Alphanumeric;
let mut rng = rand::rng();
(0..5)
.map(|_| rng.sample(Alphanumeric) as char)
.collect()
(0..5).map(|_| rng.sample(Alphanumeric) as char).collect()
}
pub fn guaranteed_mcp_server_name(user_specified_name: Option<String>, client: &MCPClient) -> String {
pub fn guaranteed_mcp_server_name(
user_specified_name: Option<String>,
client: &MCPClient,
) -> String {
if let Some(user_specified_name) = user_specified_name {
user_specified_name
} else if let Some(peer_info) = client.peer_info() {
peer_info.server_info.name.clone()
} else {
let random_name = generate_random_mcp_server_name();
log::warn!("no name was specified by the user or the client, so a random name had to be generated: `{}` for {:#?}", random_name, client);
log::warn!(
"no name was specified by the user or the client, so a random name had to be generated: `{}` for {:#?}",
random_name,
client
);
random_name
}
}
}