diff --git a/rust-toolchain b/rust-toolchain index 1894d1e..97764b3 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 6246130..c501e15 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 b1995fe..c619b14 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 96a2714..5f29b40 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 c1a44fe..18904b4 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 b2cf8a1..2328d10 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(());