refactor: run make fix

release-0.2
Meng Zhang 2023-09-11 12:58:38 +08:00
parent 09efa1b22b
commit 1ccf9b2323
3 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
[workspace]
resolver = "1"
members = [
"crates/tabby",
"crates/tabby-common",

View File

@ -31,7 +31,7 @@ pub struct FastChatEngine {
impl FastChatEngine {
pub fn create(api_endpoint: &str, model_name: &str, authorization: &str) -> Self {
let mut headers = reqwest::header::HeaderMap::new();
if authorization.len() > 0 {
if !authorization.is_empty() {
headers.insert(
"Authorization",
header::HeaderValue::from_str(authorization)

View File

@ -145,7 +145,7 @@ impl CompletionState {
fn get_param(params: &Value, key: &str) -> String {
params
.get(key)
.expect(format!("Missing {} field", key).as_str())
.unwrap_or_else(|| panic!("Missing {} field", key))
.as_str()
.expect("Type unmatched")
.to_string()