Remove unnecessary trimming and lowercasing

master
blank X 2 years ago
parent 6c2e981509
commit 0eb544a3e6
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
  1. 2
      Cargo.lock
  2. 2
      Cargo.toml
  3. 2
      src/commands/search.rs
  4. 2
      src/utils.rs

2
Cargo.lock generated

@ -202,7 +202,7 @@ dependencies = [
[[package]]
name = "hanimers"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"clap",
"quick-xml",

@ -1,6 +1,6 @@
[package]
name = "hanimers"
version = "0.1.4"
version = "0.1.5"
authors = ["blank X <theblankx@protonmail.com>"]
edition = "2018"

@ -8,7 +8,7 @@ pub const AVALIABLE_TAGS: &[&str] = &["3D", "Ahegao", "Anal", "BDSM", "Big Boobs
pub async fn search(arg_m: &ArgMatches<'_>) {
let broad_search = arg_m.is_present("broad");
let tags = arg_m.values_of("tags").unwrap_or_default().map(|i| i.trim().to_lowercase()).collect();
let tags = arg_m.values_of("tags").unwrap_or_default().collect();
let query = arg_m.values_of("query").unwrap_or_default().collect::<Vec<_>>().join(" ");
let query = query.trim();
let results = utils::search(Client::new(), query, tags, broad_search).await.unwrap();

@ -5,7 +5,7 @@ use quick_xml::events::Event;
extern crate reqwest;
extern crate serde_json;
pub async fn search(client: reqwest::Client, query: &str, tags: Vec<String>, broad_search: bool) -> Result<Vec<structs::SearchResult>, structs::Error> {
pub async fn search(client: reqwest::Client, query: &str, tags: Vec<&str>, broad_search: bool) -> Result<Vec<structs::SearchResult>, structs::Error> {
let tags_mode = match broad_search {
true => "OR",
false => "AND"

Loading…
Cancel
Save