~goorzhel/radm

b24bf5a67c4db57a96c167b5bca7b723fc58696e — Antonio Gurgel 3 months ago 4a5aae7
Tidy imports

Also clip `missing_docs` warns, which are useless in binaries.
5 files changed, 12 insertions(+), 15 deletions(-)

M src/auth.rs
M src/main.rs
M src/session.rs
M src/system.rs
M src/user.rs
M src/auth.rs => src/auth.rs +0 -2
@@ 1,7 1,5 @@
//! Authentication methods.

#![warn(missing_docs)]

use anyhow::{anyhow, Context, Result};
use nix::unistd::gethostname;


M src/main.rs => src/main.rs +8 -6
@@ 18,12 18,14 @@ mod system;
mod tui;
mod user;

use crate::auth::{login, Authenticator};
use crate::cli::{get_syslog, Options};
use crate::session::find_sessions;
use crate::system::{drop_privileges, prepare_xdg_runtime};
use crate::tui::{prompt, EchoInput};
use crate::user::User;
use crate::{
    auth::{login, Authenticator},
    cli::{get_syslog, Options},
    session::find_sessions,
    system::{drop_privileges, prepare_xdg_runtime},
    tui::{prompt, EchoInput},
    user::User,
};

fn main() {
    if let Err(e) = run().context("rstdm encountered an error") {

M src/session.rs => src/session.rs +0 -2
@@ 1,7 1,5 @@
//! Desktop entries.

#![warn(missing_docs)]

use std::{
    fmt::{Debug, Display},
    fs::read_dir,

M src/system.rs => src/system.rs +0 -2
@@ 3,8 3,6 @@
//! These functions aren't associated with [User](crate::user::User), to emphasize that they
//! run while `rstdm` still has root privileges.

#![warn(missing_docs)]

use std::{
    env::{set_var, var, VarError},
    ffi::{CString, OsStr},

M src/user.rs => src/user.rs +4 -3
@@ 1,14 1,15 @@
//! Post-authentication tasks.

use anyhow::{anyhow, Context, Error, Result};
use nix::unistd::{Gid, Uid};
use pwd::Passwd;
use std::{
    fs::File,
    io::{Read, Write},
    process::{Command, ExitStatus},
    str::FromStr,
};

use anyhow::{anyhow, Context, Error, Result};
use nix::unistd::{Gid, Uid};
use pwd::Passwd;
use xdg::BaseDirectories;

use crate::{