Skip to content

Commit

Permalink
Chore: cargo format
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Sep 27, 2023
1 parent 17a6e3c commit 048dcac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ toml_config_struct! { PasswordFieldConfig, PartialPasswordFieldConfig, RoughPass
style => InputFieldStyle [PartialInputFieldStyle, RoughInputFieldStyle],
}


toml_config_struct! { X11Config, PartialX11Config, RoughX11Config,
x11_display => String,

Expand Down
8 changes: 6 additions & 2 deletions src/post_login/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ impl PostLoginEnvironment {
ShellLoginFlag::Long => Some("--login"),
};

let mut client = lower_command_permissions_to_user(Command::new(&config.system_shell), user_info);
let mut client =
lower_command_permissions_to_user(Command::new(&config.system_shell), user_info);

let log_path = config.do_log.then_some(Path::new(&config.client_log_path));

Expand Down Expand Up @@ -277,7 +278,10 @@ pub fn get_envs(config: &Config) -> Vec<(String, PostLoginEnvironment)> {
}
}
Err(_) => {
warn!("Failed to read from the X folder '{}'", config.x11.scripts_path);
warn!(
"Failed to read from the X folder '{}'",
config.x11.scripts_path
);
}
}

Expand Down
17 changes: 10 additions & 7 deletions src/post_login/x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@ pub fn setup_x(

let mut child = Command::new(&config.system_shell);

let log_path = config.do_log.then_some(Path::new(&config.x11.xserver_log_path));
let log_path = config
.do_log
.then_some(Path::new(&config.x11.xserver_log_path));

child
.arg("-c")
.arg(format!("{} {display_value} vt{doubledigit_vtnr}", &config.x11.xserver_path));
child.arg("-c").arg(format!(
"{} {display_value} vt{doubledigit_vtnr}",
&config.x11.xserver_path
));

let mut child = LemursChild::spawn(child, log_path).map_err(|err| {
error!("Failed to start X server. Reason: {}", err);
Expand All @@ -162,9 +165,9 @@ pub fn setup_x(
let start_time = time::SystemTime::now();
loop {
if config.x11.xserver_timeout_secs == 0
|| start_time
.elapsed()
.map_or(false, |t| t.as_secs() > config.x11.xserver_timeout_secs.into())
|| start_time.elapsed().map_or(false, |t| {
t.as_secs() > config.x11.xserver_timeout_secs.into()
})
{
break;
}
Expand Down

0 comments on commit 048dcac

Please sign in to comment.