You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you change either of the clone calls to to_owned the bug appears.
good:
use std::path::PathBuf;
use std::str::FromStr;
use axum_server::tls_rustls::RustlsConfig;
pub async fn get_tls_config() -> Result<RustlsConfig, std::io::Error> {
let testval1 = PathBuf::from_str("/test").unwrap();
let testval2 = PathBuf::from_str("/test").unwrap();
RustlsConfig::from_pem_file(testval1.clone(), testval2.clone()).await
}
bad:
use std::path::PathBuf;
use std::str::FromStr;
use axum_server::tls_rustls::RustlsConfig;
pub async fn get_tls_config() -> Result<RustlsConfig, std::io::Error> {
let testval1 = PathBuf::from_str("/test").unwrap();
let testval2 = PathBuf::from_str("/test").unwrap();
RustlsConfig::from_pem_file(testval1.to_owned(), testval2.clone()).await
}
Summary
Found the offending code, which I have posted here: https://github.com/yaleman/clippy-2022-11-15/blob/main/src/lib.rs
If you change either of the
clone
calls toto_owned
the bug appears.good:
bad:
Version
Error output
Backtrace
The text was updated successfully, but these errors were encountered: