refactor: run make fix
parent
09efa1b22b
commit
1ccf9b2323
|
|
@ -1,4 +1,5 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
|
resolver = "1"
|
||||||
members = [
|
members = [
|
||||||
"crates/tabby",
|
"crates/tabby",
|
||||||
"crates/tabby-common",
|
"crates/tabby-common",
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ pub struct FastChatEngine {
|
||||||
impl FastChatEngine {
|
impl FastChatEngine {
|
||||||
pub fn create(api_endpoint: &str, model_name: &str, authorization: &str) -> Self {
|
pub fn create(api_endpoint: &str, model_name: &str, authorization: &str) -> Self {
|
||||||
let mut headers = reqwest::header::HeaderMap::new();
|
let mut headers = reqwest::header::HeaderMap::new();
|
||||||
if authorization.len() > 0 {
|
if !authorization.is_empty() {
|
||||||
headers.insert(
|
headers.insert(
|
||||||
"Authorization",
|
"Authorization",
|
||||||
header::HeaderValue::from_str(authorization)
|
header::HeaderValue::from_str(authorization)
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ impl CompletionState {
|
||||||
fn get_param(params: &Value, key: &str) -> String {
|
fn get_param(params: &Value, key: &str) -> String {
|
||||||
params
|
params
|
||||||
.get(key)
|
.get(key)
|
||||||
.expect(format!("Missing {} field", key).as_str())
|
.unwrap_or_else(|| panic!("Missing {} field", key))
|
||||||
.as_str()
|
.as_str()
|
||||||
.expect("Type unmatched")
|
.expect("Type unmatched")
|
||||||
.to_string()
|
.to_string()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue