Adding semicolons according to lint
https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
This commit is contained in:
parent
fe1556b099
commit
6c6f66cdf8
@ -78,9 +78,5 @@ args = ["clippy", "--all-features", "--",
|
|||||||
"--warn", "warnings",
|
"--warn", "warnings",
|
||||||
"--warn", "clippy::pedantic",
|
"--warn", "clippy::pedantic",
|
||||||
"--warn", "clippy::nursery",
|
"--warn", "clippy::nursery",
|
||||||
"--allow", "clippy::wildcard_imports", # for `use seed::{prelude::*, *};`
|
|
||||||
"--allow", "clippy::future_not_send", # JS/WASM is single threaded
|
"--allow", "clippy::future_not_send", # JS/WASM is single threaded
|
||||||
"--allow", "clippy::used_underscore_binding", # some libraries break this rule
|
|
||||||
"--allow", "clippy::eval_order_dependence", # false positives
|
|
||||||
"--allow", "clippy::vec_init_then_push", # Vec::new() + push are used in macros in shortcuts.rs
|
|
||||||
]
|
]
|
@ -171,12 +171,12 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
|||||||
}
|
}
|
||||||
Msg::ListLinks(msg) => {
|
Msg::ListLinks(msg) => {
|
||||||
if let Page::Home(model) = &mut model.page {
|
if let Page::Home(model) = &mut model.page {
|
||||||
list_links::update(msg, model, &mut orders.proxy(Msg::ListLinks))
|
list_links::update(msg, model, &mut orders.proxy(Msg::ListLinks));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Msg::ListUsers(msg) => {
|
Msg::ListUsers(msg) => {
|
||||||
if let Page::ListUsers(model) = &mut model.page {
|
if let Page::ListUsers(model) = &mut model.page {
|
||||||
list_users::update(msg, model, &mut orders.proxy(Msg::ListUsers))
|
list_users::update(msg, model, &mut orders.proxy(Msg::ListUsers));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Msg::NoMessage => (),
|
Msg::NoMessage => (),
|
||||||
@ -211,13 +211,13 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
|||||||
Msg::NotAuthenticated => {
|
Msg::NotAuthenticated => {
|
||||||
if model.user.is_some() {
|
if model.user.is_some() {
|
||||||
model.user = Loadable::Data(None);
|
model.user = Loadable::Data(None);
|
||||||
logout(orders)
|
logout(orders);
|
||||||
}
|
}
|
||||||
model.user = Loadable::Data(None);
|
model.user = Loadable::Data(None);
|
||||||
}
|
}
|
||||||
Msg::Logout => {
|
Msg::Logout => {
|
||||||
model.user = Loadable::Data(None);
|
model.user = Loadable::Data(None);
|
||||||
logout(orders)
|
logout(orders);
|
||||||
}
|
}
|
||||||
Msg::Login => login_user(model, orders),
|
Msg::Login => login_user(model, orders),
|
||||||
Msg::UsernameChanged(s) => model.login_data.username = s,
|
Msg::UsernameChanged(s) => model.login_data.username = s,
|
||||||
|
@ -220,7 +220,7 @@ pub fn process_query_messages(msg: QueryMsg, model: &mut Model, orders: &mut imp
|
|||||||
LinkOverviewColumns::Statistics => {
|
LinkOverviewColumns::Statistics => {
|
||||||
|o: &FullLink, t: &FullLink| o.clicks.number.cmp(&t.clicks.number)
|
|o: &FullLink, t: &FullLink| o.clicks.number.cmp(&t.clicks.number)
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
QueryMsg::Received(response) => {
|
QueryMsg::Received(response) => {
|
||||||
model.links = response;
|
model.links = response;
|
||||||
@ -304,7 +304,7 @@ pub fn process_edit_messages(msg: EditMsg, model: &mut Model, orders: &mut impl
|
|||||||
model.handle_render = Some(orders.perform_cmd_with_handle(async move {
|
model.handle_render = Some(orders.perform_cmd_with_handle(async move {
|
||||||
let qr_code = Loadable::Data(Some(QrGuard::new(&code)));
|
let qr_code = Loadable::Data(Some(QrGuard::new(&code)));
|
||||||
Msg::Edit(EditMsg::QrGenerated(qr_code))
|
Msg::Edit(EditMsg::QrGenerated(qr_code))
|
||||||
}))
|
}));
|
||||||
}
|
}
|
||||||
EditMsg::QrGenerated(qr_code) => {
|
EditMsg::QrGenerated(qr_code) => {
|
||||||
let new_dialog = if let Dialog::EditLink {
|
let new_dialog = if let Dialog::EditLink {
|
||||||
@ -381,7 +381,7 @@ pub fn process_edit_messages(msg: EditMsg, model: &mut Model, orders: &mut impl
|
|||||||
// capture including the message part
|
// capture including the message part
|
||||||
link @ EditMsg::MayDeleteSelected(..) => {
|
link @ EditMsg::MayDeleteSelected(..) => {
|
||||||
clear_all(model);
|
clear_all(model);
|
||||||
model.dialog = Dialog::Question(link)
|
model.dialog = Dialog::Question(link);
|
||||||
}
|
}
|
||||||
EditMsg::DeleteSelected(link) => delete_link(link, orders),
|
EditMsg::DeleteSelected(link) => delete_link(link, orders),
|
||||||
EditMsg::FailedToDeleteLink => log!("Failed to delete Link"),
|
EditMsg::FailedToDeleteLink => log!("Failed to delete Link"),
|
||||||
|
@ -141,7 +141,7 @@ pub fn process_query_messages(msg: UserQueryMsg, model: &mut Model, orders: &mut
|
|||||||
UserOverviewColumns::Id => |o: &User, t: &User| o.id.cmp(&t.id),
|
UserOverviewColumns::Id => |o: &User, t: &User| o.id.cmp(&t.id),
|
||||||
UserOverviewColumns::Username => |o: &User, t: &User| o.username.cmp(&t.username),
|
UserOverviewColumns::Username => |o: &User, t: &User| o.username.cmp(&t.username),
|
||||||
UserOverviewColumns::Email => |o: &User, t: &User| o.email.cmp(&t.email),
|
UserOverviewColumns::Email => |o: &User, t: &User| o.email.cmp(&t.email),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
UserQueryMsg::Received(response) => {
|
UserQueryMsg::Received(response) => {
|
||||||
model.users = response;
|
model.users = response;
|
||||||
@ -212,11 +212,11 @@ pub fn process_user_edit_messages(
|
|||||||
match msg {
|
match msg {
|
||||||
UserEditMsg::EditUserSelected(user) => {
|
UserEditMsg::EditUserSelected(user) => {
|
||||||
model.clean_dialogs();
|
model.clean_dialogs();
|
||||||
model.user_edit = Some(user)
|
model.user_edit = Some(user);
|
||||||
}
|
}
|
||||||
UserEditMsg::CreateNewUser => {
|
UserEditMsg::CreateNewUser => {
|
||||||
model.clean_dialogs();
|
model.clean_dialogs();
|
||||||
model.user_edit = Some(UserDelta::default())
|
model.user_edit = Some(UserDelta::default());
|
||||||
}
|
}
|
||||||
UserEditMsg::EditUsernameChanged(s) => {
|
UserEditMsg::EditUsernameChanged(s) => {
|
||||||
if let Some(ref mut ue) = model.user_edit {
|
if let Some(ref mut ue) = model.user_edit {
|
||||||
@ -251,7 +251,7 @@ pub fn process_user_edit_messages(
|
|||||||
orders.send_msg(Msg::Query(UserQueryMsg::Fetch));
|
orders.send_msg(Msg::Query(UserQueryMsg::Fetch));
|
||||||
}
|
}
|
||||||
UserEditMsg::MakeAdmin(user) | UserEditMsg::MakeRegular(user) => {
|
UserEditMsg::MakeAdmin(user) | UserEditMsg::MakeRegular(user) => {
|
||||||
update_privileges(user, orders)
|
update_privileges(user, orders);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ async fn parse_args_to_config(config: ArgMatches<'_>) -> ServerConfig {
|
|||||||
warn!("If you change the secret all passwords will be invalid");
|
warn!("If you change the secret all passwords will be invalid");
|
||||||
warn!("Using an auto generated one for this run.");
|
warn!("Using an auto generated one for this run.");
|
||||||
} else {
|
} else {
|
||||||
warn!("The provided secret was too short. Using an autogenerated one.")
|
warn!("The provided secret was too short. Using an autogenerated one.");
|
||||||
}
|
}
|
||||||
|
|
||||||
thread_rng()
|
thread_rng()
|
||||||
@ -363,7 +363,7 @@ fn generate_env_file(server_config: &ServerConfig) -> Result<(), ServerError> {
|
|||||||
|
|
||||||
for line in &conf_file_content {
|
for line in &conf_file_content {
|
||||||
file.write_all(line.as_bytes())
|
file.write_all(line.as_bytes())
|
||||||
.expect("failed to write .env file")
|
.expect("failed to write .env file");
|
||||||
}
|
}
|
||||||
info!("Successfully created the env file!");
|
info!("Successfully created the env file!");
|
||||||
|
|
||||||
|
@ -206,7 +206,12 @@ static_loader! {
|
|||||||
/// # Errors
|
/// # Errors
|
||||||
/// This produces a [`ServerError`] if:
|
/// This produces a [`ServerError`] if:
|
||||||
/// * The server failed to bind to the designated port.
|
/// * The server failed to bind to the designated port.
|
||||||
#[allow(clippy::future_not_send, clippy::too_many_lines)]
|
#[allow(
|
||||||
|
clippy::future_not_send,
|
||||||
|
clippy::too_many_lines,
|
||||||
|
unknown_lints,
|
||||||
|
clippy::unused_async
|
||||||
|
)]
|
||||||
pub async fn webservice(
|
pub async fn webservice(
|
||||||
server_config: ServerConfig,
|
server_config: ServerConfig,
|
||||||
) -> Result<actix_web::dev::Server, std::io::Error> {
|
) -> Result<actix_web::dev::Server, std::io::Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user