Remove references that are implicitly dereferenced
This are implicitly dereferenced by the compiler and a no-op.
This commit is contained in:
parent
9c97b6aa2c
commit
755c42b8d8
|
@ -44,11 +44,11 @@ fn get_issue() -> Result<String, Box<dyn std::error::Error>> {
|
|||
&get_distro_name().unwrap_or_else(|_| "Linux".to_string()),
|
||||
)
|
||||
.replace("\\l", &format!("tty{}", vtnr))
|
||||
.replace("\\s", &uts.sysname().to_str().unwrap())
|
||||
.replace("\\r", &uts.release().to_str().unwrap())
|
||||
.replace("\\v", &uts.version().to_str().unwrap())
|
||||
.replace("\\n", &uts.nodename().to_str().unwrap())
|
||||
.replace("\\m", &uts.machine().to_str().unwrap())
|
||||
.replace("\\s", uts.sysname().to_str().unwrap())
|
||||
.replace("\\r", uts.release().to_str().unwrap())
|
||||
.replace("\\v", uts.version().to_str().unwrap())
|
||||
.replace("\\n", uts.nodename().to_str().unwrap())
|
||||
.replace("\\m", uts.machine().to_str().unwrap())
|
||||
.replace("\\\\", "\\"))
|
||||
}
|
||||
|
||||
|
|
|
@ -128,12 +128,12 @@ async fn client_handler(ctx: &Context, mut s: UnixStream) -> Result<(), Error> {
|
|||
println!("req: {:?}", req);
|
||||
let resp = match req {
|
||||
Request::CreateSession { username } => match ctx.create_session(username).await {
|
||||
Ok(()) => client_get_question(&ctx).await,
|
||||
Ok(()) => client_get_question(ctx).await,
|
||||
res => wrap_result(res),
|
||||
},
|
||||
Request::PostAuthMessageResponse { response } => {
|
||||
match ctx.post_response(response).await {
|
||||
Ok(()) => client_get_question(&ctx).await,
|
||||
Ok(()) => client_get_question(ctx).await,
|
||||
res => wrap_result(res),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ impl Context {
|
|||
let mut scheduled_session = Session::new_external()?;
|
||||
scheduled_session
|
||||
.initiate(
|
||||
&service,
|
||||
service,
|
||||
class,
|
||||
user,
|
||||
false,
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<'a> PamSession<'a> {
|
|||
pam_conv: Pin<Box<dyn Converse + 'a>>,
|
||||
) -> Result<PamSession<'a>, PamError> {
|
||||
let mut pch = Box::pin(PamConvHandlerWrapper { handler: pam_conv });
|
||||
let conv = make_conversation(&mut *pch);
|
||||
let conv = make_conversation(&mut pch);
|
||||
let mut pam_handle: *mut PamHandle = ptr::null_mut();
|
||||
|
||||
match pam_sys::start(service, Some(user), &conv, &mut pam_handle) {
|
||||
|
|
|
@ -76,12 +76,12 @@ async fn client_handler(ctx: &Context, mut s: UnixStream) -> Result<(), Error> {
|
|||
|
||||
let resp = match req {
|
||||
Request::CreateSession { username } => match ctx.create_session(username).await {
|
||||
Ok(()) => client_get_question(&ctx).await,
|
||||
Ok(()) => client_get_question(ctx).await,
|
||||
res => wrap_result(res),
|
||||
},
|
||||
Request::PostAuthMessageResponse { response } => {
|
||||
match ctx.post_response(response).await {
|
||||
Ok(()) => client_get_question(&ctx).await,
|
||||
Ok(()) => client_get_question(ctx).await,
|
||||
res => wrap_result(res),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ pub fn parse<'a>(s: &'a str) -> Result<Inish<'a>, Box<dyn Error>> {
|
|||
sections.insert(current_section_name, current_section);
|
||||
current_section = HashMap::new();
|
||||
let len = line.bytes().count();
|
||||
current_section_name = &line[1..len - 1].trim();
|
||||
current_section_name = line[1..len - 1].trim();
|
||||
}
|
||||
(Some('['), v) => {
|
||||
return Err(format!(
|
||||
|
|
Loading…
Reference in New Issue