Skip to content

Commit

Permalink
style: use upper camel case in enums
Browse files Browse the repository at this point in the history
  • Loading branch information
phra committed Jul 2, 2019
1 parent b8599ac commit df628ad
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
38 changes: 19 additions & 19 deletions src/tildebuster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ impl TildeBuster {
}
}
None => match msg.kind {
FSObject::NOT_EXISTING => {
FSObject::NotExisting => {
trace!("{:?}", msg);
}
FSObject::DUPLICATE_FILE => {
FSObject::DuplicateFile => {
if no_progress_bar {
println!(
"File\t\t{}~{}.{}",
Expand All @@ -200,7 +200,7 @@ impl TildeBuster {

result_processor.maybe_add_result(msg);
}
FSObject::DUPLICATE_DIRECTORY => {
FSObject::DuplicateDirectory => {
if no_progress_bar {
println!(
"Directory\t{}~{}",
Expand All @@ -217,7 +217,7 @@ impl TildeBuster {

result_processor.maybe_add_result(msg);
}
FSObject::FILE => {
FSObject::File => {
if no_progress_bar {
println!(
"File\t\t{}~{}.{}",
Expand Down Expand Up @@ -247,7 +247,7 @@ impl TildeBuster {

result_processor.maybe_add_result(msg);
}
FSObject::DIRECTORY => {
FSObject::Directory => {
if no_progress_bar {
println!("Directory\t{}~{}", msg.request.filename, msg.request.duplicate_index);
} else {
Expand All @@ -270,7 +270,7 @@ impl TildeBuster {

result_processor.maybe_add_result(msg);
}
FSObject::BRUTE_EXTENSION => {
FSObject::BruteExtension => {
for c in chars1.iter() {
let mut request = msg.request.clone();
request.extension =
Expand All @@ -283,7 +283,7 @@ impl TildeBuster {
spawned_futures = spawned_futures + 1;
}
}
FSObject::BRUTE_FILENAME => {
FSObject::BruteFilename => {
for c in chars1.iter() {
let mut request = msg.request.clone();
request.filename =
Expand All @@ -296,7 +296,7 @@ impl TildeBuster {
spawned_futures = spawned_futures + 1;
}
}
FSObject::CHECK_IF_DIRECTORY => {
FSObject::CheckIfDirectory => {
tx_futures.unbounded_send(Box::new(TildeBuster::_check_if_directory(
tx1.clone(),
client1.clone(),
Expand Down Expand Up @@ -357,23 +357,23 @@ impl TildeBuster {
match (res.status(), request.extension.len()) {
(hyper::StatusCode::NOT_FOUND, 3) => {
let res = SingleTildeScanResult {
kind: FSObject::FILE,
kind: FSObject::File,
error: None,
request: request,
};
tx.send(res).unwrap();
}
(hyper::StatusCode::NOT_FOUND, _) => {
let res = SingleTildeScanResult {
kind: FSObject::BRUTE_EXTENSION,
kind: FSObject::BruteExtension,
error: None,
request: request,
};
tx.send(res).unwrap();
}
(hyper::StatusCode::BAD_REQUEST, _) | _ => {
let res = SingleTildeScanResult {
kind: FSObject::NOT_EXISTING,
kind: FSObject::NotExisting,
error: None,
request: request,
};
Expand Down Expand Up @@ -435,23 +435,23 @@ impl TildeBuster {
match (res.status(), res_short.status()) {
(_, hyper::StatusCode::NOT_FOUND) => {
let res = SingleTildeScanResult {
kind: FSObject::CHECK_IF_DIRECTORY,
kind: FSObject::CheckIfDirectory,
error: None,
request: request,
};
tx.send(res).unwrap();
}
(hyper::StatusCode::NOT_FOUND, _) => {
let res = SingleTildeScanResult {
kind: FSObject::BRUTE_FILENAME,
kind: FSObject::BruteFilename,
error: None,
request: request,
};
tx.send(res).unwrap();
}
(hyper::StatusCode::BAD_REQUEST, _) | _ => {
let res = SingleTildeScanResult {
kind: FSObject::NOT_EXISTING,
kind: FSObject::NotExisting,
error: None,
request: request,
};
Expand Down Expand Up @@ -496,15 +496,15 @@ impl TildeBuster {
match res.status() {
hyper::StatusCode::NOT_FOUND => {
let res = SingleTildeScanResult {
kind: FSObject::DIRECTORY,
kind: FSObject::Directory,
error: None,
request: request,
};
tx.send(res).unwrap();
}
hyper::StatusCode::BAD_REQUEST | _ => {
let res = SingleTildeScanResult {
kind: FSObject::BRUTE_EXTENSION,
kind: FSObject::BruteExtension,
error: None,
request: request,
};
Expand Down Expand Up @@ -656,23 +656,23 @@ impl TildeBuster {
match (res.status(), request.extension.len()) {
(hyper::StatusCode::NOT_FOUND, 3) => {
let res = SingleTildeScanResult {
kind: FSObject::DUPLICATE_FILE,
kind: FSObject::DuplicateFile,
error: None,
request: request,
};
tx.send(res).unwrap();
}
(hyper::StatusCode::NOT_FOUND, _) => {
let res = SingleTildeScanResult {
kind: FSObject::DUPLICATE_DIRECTORY,
kind: FSObject::DuplicateDirectory,
error: None,
request: request,
};
tx.send(res).unwrap();
}
(hyper::StatusCode::BAD_REQUEST, _) | _ => {
let res = SingleTildeScanResult {
kind: FSObject::NOT_EXISTING,
kind: FSObject::NotExisting,
error: None,
request: request,
};
Expand Down
16 changes: 8 additions & 8 deletions src/tildebuster/result_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use std::{fs::File, io::Write, path::Path, str};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum FSObject {
FILE,
DIRECTORY,
DUPLICATE_FILE,
DUPLICATE_DIRECTORY,
BRUTE_FILENAME,
BRUTE_EXTENSION,
CHECK_IF_DIRECTORY,
NOT_EXISTING,
File,
Directory,
DuplicateFile,
DuplicateDirectory,
BruteFilename,
BruteExtension,
CheckIfDirectory,
NotExisting,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
Expand Down

0 comments on commit df628ad

Please sign in to comment.