~goorzhel/radm

4378fef3094fd63025b27007add8b9ff40ef3390 — Antonio Gurgel 3 months ago cc44661
Trim overqualified identifiers
2 files changed, 5 insertions(+), 3 deletions(-)

M src/system.rs
M src/user.rs
M src/system.rs => src/system.rs +2 -2
@@ 9,7 9,7 @@ use std::{
    fmt::Display,
    fs::{create_dir_all, set_permissions, Permissions},
    os::unix::prelude::PermissionsExt,
    path::Path,
    path::{Path, PathBuf},
};

use anyhow::{Context, Result};


@@ 39,7 39,7 @@ pub fn prepare_xdg_runtime(user: &User) -> Result<()> {
    let uid = user.uid;
    let gid = user.gid;

    let path: std::path::PathBuf = var("XDG_RUNTIME_DIR").unwrap().into();
    let path: PathBuf = var("XDG_RUNTIME_DIR").unwrap().into();
    // unwrap: $XDG_RUNTIME_DIR should already be set by User::load_environment.
    create_dir_all(&path).context("Failed to create XDG_RUNTIME_DIR")?;
    chown(&path, Some(uid), Some(gid)).context("Failed to chown XDG_RUNTIME_DIR")?;

M src/user.rs => src/user.rs +3 -1
@@ 5,6 5,8 @@ use std::{
    io::{Read, Write},
    process::{Command, ExitStatus},
    str::FromStr,
    thread::sleep,
    time::Duration,
};

use anyhow::{anyhow, Context, Error, Result};


@@ 159,7 161,7 @@ impl User {
                "Found only one session ({}); starting it now.",
                session.name
            );
            std::thread::sleep(std::time::Duration::from_secs(1));
            sleep(Duration::from_secs(1));
            return Ok(session);
        }