satisfy clippy nightly warnings

This commit is contained in:
glyph 2022-01-12 13:15:04 +02:00
parent 2a7c893d94
commit 69ba400b69
6 changed files with 13 additions and 18 deletions

4
Cargo.lock generated
View File

@ -2492,8 +2492,8 @@ dependencies = [
"jsonrpc-http-server 18.0.0",
"jsonrpc-test 18.0.0",
"log 0.4.14",
"miniserde",
"peach-stats",
"serde_json",
]
[[package]]
@ -2585,7 +2585,7 @@ dependencies = [
[[package]]
name = "peach-web"
version = "0.4.17"
version = "0.5.0"
dependencies = [
"env_logger 0.8.4",
"log 0.4.14",

View File

@ -7,7 +7,7 @@ use crate::{config_manager, error::PeachError, sbot_client};
/// and returns Err if the supplied password is incorrect.
pub fn verify_password(password: &str) -> Result<(), PeachError> {
let real_admin_password_hash = config_manager::get_admin_password_hash()?;
let password_hash = hash_password(&password.to_string());
let password_hash = hash_password(password);
if real_admin_password_hash == password_hash {
Ok(())
} else {
@ -29,7 +29,7 @@ pub fn validate_new_passwords(new_password1: &str, new_password2: &str) -> Resul
/// Sets a new password for the admin user
pub fn set_new_password(new_password: &str) -> Result<(), PeachError> {
let new_password_hash = hash_password(&new_password.to_string());
let new_password_hash = hash_password(new_password);
config_manager::set_admin_password_hash(&new_password_hash)?;
Ok(())
@ -49,7 +49,7 @@ pub fn hash_password(password: &str) -> String {
/// Sets a new temporary password for the admin user
/// which can be used to reset the permanent password
pub fn set_new_temporary_password(new_password: &str) -> Result<(), PeachError> {
let new_password_hash = hash_password(&new_password.to_string());
let new_password_hash = hash_password(new_password);
config_manager::set_temporary_password_hash(&new_password_hash)?;
Ok(())
@ -59,7 +59,7 @@ pub fn set_new_temporary_password(new_password: &str) -> Result<(), PeachError>
/// and returns Err if the supplied temp_password is incorrect
pub fn verify_temporary_password(password: &str) -> Result<(), PeachError> {
let temporary_admin_password_hash = config_manager::get_temporary_password_hash()?;
let password_hash = hash_password(&password.to_string());
let password_hash = hash_password(password);
if temporary_admin_password_hash == password_hash {
Ok(())
} else {

View File

@ -67,7 +67,7 @@ pub fn create_invite(uses: i32) -> Result<String, PeachError> {
.arg(uses.to_string())
.output()?;
let text_output = std::str::from_utf8(&output.stdout)?;
let output = text_output.replace("\n", "");
let output = text_output.replace('\n', "");
Ok(output)
}

View File

@ -138,7 +138,7 @@ pub fn available_networks(iface: &str) -> Result<Option<Vec<Scan>>, NetworkError
// we only want to return the auth / crypto flags
if flags_vec[0] != "[ESS]" {
// parse auth / crypto flag and assign it to protocol
protocol.push_str(flags_vec[0].replace("[", "").replace("]", "").as_str());
protocol.push_str(flags_vec[0].replace('[', "").replace(']', "").as_str());
}
let ssid = v[4].to_string();
let response = Scan {

View File

@ -1,6 +1,6 @@
# peach-web
[![Build Status](https://travis-ci.com/peachcloud/peach-web.svg?branch=master)](https://travis-ci.com/peachcloud/peach-web) ![Generic badge](https://img.shields.io/badge/version-0.4.12-<COLOR>.svg)
[![Build Status](https://travis-ci.com/peachcloud/peach-web.svg?branch=master)](https://travis-ci.com/peachcloud/peach-web) ![Generic badge](https://img.shields.io/badge/version-0.5.0-<COLOR>.svg)
## Web Interface for PeachCloud

View File

@ -117,16 +117,11 @@ impl StatusContext {
}
// test if go-sbot is running
let sbot_is_online: bool;
let sbot_is_online_result = sbot_client::is_sbot_online();
match sbot_is_online_result {
Ok(val) => {
sbot_is_online = val;
}
Err(_err) => {
sbot_is_online = false;
}
}
let sbot_is_online: bool = match sbot_is_online_result {
Ok(val) => val,
Err(_err) => false,
};
StatusContext {
back: None,