refactor: remove beef dependency for now

This is just a temp change, I wanted to remove it just for clarity's
sake among dependencies, and will probably add it back in the future.

For now I'll just stick to std's beef.
This commit is contained in:
ClementTsang 2021-07-12 22:31:55 -04:00
parent 01554758a0
commit 70242bc2b2
5 changed files with 6 additions and 17 deletions

7
Cargo.lock generated
View File

@ -209,12 +209,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "beef"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.2.1"
@ -243,7 +237,6 @@ dependencies = [
"assert_cmd", "assert_cmd",
"backtrace", "backtrace",
"battery", "battery",
"beef",
"cargo-husky", "cargo-husky",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"chrono", "chrono",

View File

@ -37,7 +37,6 @@ default = ["fern", "log"]
anyhow = "1.0.40" anyhow = "1.0.40"
backtrace = "0.3.59" backtrace = "0.3.59"
battery = "0.7.8" battery = "0.7.8"
beef = "0.5.0"
chrono = "0.4.19" chrono = "0.4.19"
crossterm = "0.18.2" crossterm = "0.18.2"
ctrlc = { version = "3.1.9", features = ["termination"] } ctrlc = { version = "3.1.9", features = ["termination"] }

View File

@ -6,8 +6,8 @@ use crate::{
Result, Result,
}, },
}; };
use std::collections::VecDeque;
use std::fmt::Debug; use std::fmt::Debug;
use std::{borrow::Cow, collections::VecDeque};
const DELIMITER_LIST: [char; 6] = ['=', '>', '<', '(', ')', '\"']; const DELIMITER_LIST: [char; 6] = ['=', '>', '<', '(', ')', '\"'];
const COMPARISON_LIST: [&str; 3] = [">", "=", "<"]; const COMPARISON_LIST: [&str; 3] = [">", "=", "<"];
@ -79,7 +79,7 @@ impl ProcessQuery for ProcWidgetState {
break; break;
} }
} else if COMPARISON_LIST.contains(&queue_top.to_lowercase().as_str()) { } else if COMPARISON_LIST.contains(&queue_top.to_lowercase().as_str()) {
return Err(QueryError(beef::Cow::borrowed("Comparison not valid here"))); return Err(QueryError(Cow::Borrowed("Comparison not valid here")));
} else { } else {
break; break;
} }
@ -118,7 +118,7 @@ impl ProcessQuery for ProcWidgetState {
break; break;
} }
} else if COMPARISON_LIST.contains(&queue_top.to_lowercase().as_str()) { } else if COMPARISON_LIST.contains(&queue_top.to_lowercase().as_str()) {
return Err(QueryError(beef::Cow::borrowed("Comparison not valid here"))); return Err(QueryError(Cow::Borrowed("Comparison not valid here")));
} else { } else {
break; break;
} }
@ -164,9 +164,7 @@ impl ProcessQuery for ProcWidgetState {
} }
} else if queue_top == "(" { } else if queue_top == "(" {
if query.is_empty() { if query.is_empty() {
return Err(QueryError(beef::Cow::borrowed( return Err(QueryError(Cow::Borrowed("Missing closing parentheses")));
"Missing closing parentheses",
)));
} }
let mut list_of_ors = VecDeque::new(); let mut list_of_ors = VecDeque::new();

View File

@ -1,7 +1,7 @@
use beef::Cow;
use regex::Regex; use regex::Regex;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{ use std::{
borrow::Cow,
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
path::PathBuf, path::PathBuf,
str::FromStr, str::FromStr,

View File

@ -1,5 +1,4 @@
use beef::Cow; use std::{borrow::Cow, result};
use std::result;
use thiserror::Error; use thiserror::Error;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]