This commit is contained in:
rustdesk 2023-02-08 17:07:27 +08:00
parent e2f4962ba8
commit 6ec46cb95f
3 changed files with 3 additions and 6 deletions

View File

@ -288,7 +288,7 @@ fn patch(path: PathBuf) -> PathBuf {
.trim() .trim()
.to_owned(); .to_owned();
if user != "root" { if user != "root" {
return format!("/home/{}", user).into(); return format!("/home/{user}").into();
} }
} }
} }

View File

@ -211,10 +211,7 @@ pub fn gen_version() {
// generate build date // generate build date
let build_date = format!("{}", chrono::Local::now().format("%Y-%m-%d %H:%M")); let build_date = format!("{}", chrono::Local::now().format("%Y-%m-%d %H:%M"));
file.write_all( file.write_all(
format!( format!("#[allow(dead_code)]\npub const BUILD_DATE: &str = \"{build_date}\";\n").as_bytes(),
"#[allow(dead_code)]\npub const BUILD_DATE: &str = \"{build_date}\"\n;"
)
.as_bytes(),
) )
.ok(); .ok();
file.sync_all().ok(); file.sync_all().ok();

View File

@ -60,7 +60,7 @@ fn get_display_server_of_session(session: &str) -> String {
.replace("TTY=", "") .replace("TTY=", "")
.trim_end() .trim_end()
.into(); .into();
if let Ok(xorg_results) = run_cmds(format!("ps -e | grep \"{}.\\\\+Xorg\"", tty)) if let Ok(xorg_results) = run_cmds(format!("ps -e | grep \"{tty}.\\\\+Xorg\""))
// And check if Xorg is running on that tty // And check if Xorg is running on that tty
{ {
if xorg_results.trim_end() != "" { if xorg_results.trim_end() != "" {