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

View file

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

View file

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

View file

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

View file

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