Run rustfmt

This commit is contained in:
Joakim Frostegård 2021-10-16 17:49:00 +02:00
parent 523a21dac4
commit 3678e86654
7 changed files with 27 additions and 22 deletions

View file

@ -146,17 +146,21 @@ fn read_requests(
}
match request {
Ok(Request::Announce(AnnounceRequest { info_hash, transaction_id, ..})) if !state.access_list.allows(access_list_mode, &info_hash.0) => {
Ok(Request::Announce(AnnounceRequest {
info_hash,
transaction_id,
..
})) if !state.access_list.allows(access_list_mode, &info_hash.0) => {
let response = Response::Error(ErrorResponse {
transaction_id,
message: "Info hash not allowed".into()
message: "Info hash not allowed".into(),
});
local_responses.push((response, src))
},
}
Ok(request) => {
requests.push((request, src));
},
}
Err(err) => {
::log::debug!("request_from_bytes error: {:?}", err);

View file

@ -11,10 +11,7 @@ use crate::config::Config;
pub fn update_access_list(config: &Config, state: &State) {
match config.access_list.mode {
AccessListMode::Require | AccessListMode::Forbid => {
if let Err(err) = state
.access_list
.update_from_path(&config.access_list.path)
{
if let Err(err) = state.access_list.update_from_path(&config.access_list.path) {
::log::error!("Update access list from path: {:?}", err);
}
}