From 841bbe85da14c0e929ce74b35868324b18881c74 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 10 Jul 2024 10:55:18 +0200 Subject: [PATCH] bumped rust --- rust-toolchain | 2 +- warpgate-common/src/config/mod.rs | 2 +- warpgate-protocol-ssh/src/server/session.rs | 2 +- warpgate-web/src/lib.rs | 4 +--- warpgate/src/commands/setup.rs | 2 +- warpgate/src/commands/test_target.rs | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 1894d1e9d..97764b39b 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-11-28 +nightly-2024-02-04 diff --git a/warpgate-common/src/config/mod.rs b/warpgate-common/src/config/mod.rs index 6246130b4..c501e1592 100644 --- a/warpgate-common/src/config/mod.rs +++ b/warpgate-common/src/config/mod.rs @@ -365,7 +365,7 @@ impl WarpgateConfig { if let Some(request) = for_request { // 3: Host header in the request - scheme = request.uri().scheme().map(Clone::clone).unwrap_or(scheme); + scheme = request.uri().scheme().cloned().unwrap_or(scheme); if let Some(host_header) = request.header(http::header::HOST).map(|x| x.to_string()) { if let Ok(host_port) = Url::parse(&format!("https://{host_header}/")) { diff --git a/warpgate-protocol-ssh/src/server/session.rs b/warpgate-protocol-ssh/src/server/session.rs index b1995fe4a..c619b1435 100644 --- a/warpgate-protocol-ssh/src/server/session.rs +++ b/warpgate-protocol-ssh/src/server/session.rs @@ -244,7 +244,7 @@ impl ServerSession { self.auth_state = Some(state); } #[allow(clippy::unwrap_used)] - Ok(self.auth_state.as_ref().map(Clone::clone).unwrap()) + Ok(self.auth_state.as_ref().cloned().unwrap()) } pub fn make_logging_span(&self) -> tracing::Span { diff --git a/warpgate-web/src/lib.rs b/warpgate-web/src/lib.rs index 96a271480..5f29b40a5 100644 --- a/warpgate-web/src/lib.rs +++ b/warpgate-web/src/lib.rs @@ -33,7 +33,5 @@ pub fn lookup_built_file(source: &str) -> Result { let obj: HashMap = serde_json::from_slice(&file.data)?; - obj.get(source) - .map(Clone::clone) - .ok_or(LookupError::FileNotFound) + obj.get(source).cloned().ok_or(LookupError::FileNotFound) } diff --git a/warpgate/src/commands/setup.rs b/warpgate/src/commands/setup.rs index c1a44fe55..18904b4a6 100644 --- a/warpgate/src/commands/setup.rs +++ b/warpgate/src/commands/setup.rs @@ -14,7 +14,7 @@ use uuid::Uuid; use warpgate_common::helpers::fs::{secure_directory, secure_file}; use warpgate_common::helpers::hash::hash_password; use warpgate_common::{ - HttpConfig, ListenEndpoint, MySqlConfig, SshConfig, Secret, UserAuthCredential, + HttpConfig, ListenEndpoint, MySqlConfig, Secret, SshConfig, UserAuthCredential, UserPasswordCredential, UserRequireCredentialsPolicy, WarpgateConfigStore, WarpgateError, }; use warpgate_core::consts::{BUILTIN_ADMIN_ROLE_NAME, BUILTIN_ADMIN_USERNAME}; diff --git a/warpgate/src/commands/test_target.rs b/warpgate/src/commands/test_target.rs index b2cf8a122..2328d10ec 100644 --- a/warpgate/src/commands/test_target.rs +++ b/warpgate/src/commands/test_target.rs @@ -17,7 +17,7 @@ pub(crate) async fn command(cli: &crate::Cli, target_name: &String) -> Result<() .await? .iter() .find(|x| &x.name == target_name) - .map(Target::clone) + .cloned() else { error!("Target not found: {}", target_name); return Ok(());