Skip to content

Commit b4cf6c0

Browse files
committed
fix: apply cargo fmt for v1.5
1 parent 1c0065d commit b4cf6c0

3 files changed

Lines changed: 44 additions & 11 deletions

File tree

src/http.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,10 @@ async fn health_check() -> &'static str {
392392
}
393393

394394
async fn handle_openapi(State(state): State<ApiState>) -> impl IntoResponse {
395-
let default_url = format!("http://{}:{}", state.http_config.host, state.http_config.port);
395+
let default_url = format!(
396+
"http://{}:{}",
397+
state.http_config.host, state.http_config.port
398+
);
396399
let server_url = state
397400
.http_config
398401
.plugin
@@ -404,7 +407,10 @@ async fn handle_openapi(State(state): State<ApiState>) -> impl IntoResponse {
404407
}
405408

406409
async fn handle_plugin_manifest(State(state): State<ApiState>) -> impl IntoResponse {
407-
let default_url = format!("http://{}:{}", state.http_config.host, state.http_config.port);
410+
let default_url = format!(
411+
"http://{}:{}",
412+
state.http_config.host, state.http_config.port
413+
);
408414
let server_url = state
409415
.http_config
410416
.plugin

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,9 @@ async fn main() -> Result<()> {
874874
"3. ChatGPT \u{2192} Create GPT \u{2192} Add Action \u{2192} Import from: {url}/openapi.json"
875875
);
876876
} else {
877-
println!("3. ChatGPT \u{2192} Create GPT \u{2192} Add Action \u{2192} Import from: <your-tunnel-url>/openapi.json");
877+
println!(
878+
"3. ChatGPT \u{2192} Create GPT \u{2192} Add Action \u{2192} Import from: <your-tunnel-url>/openapi.json"
879+
);
878880
}
879881
println!("4. Auth: API Key, Bearer, paste your key");
880882
}

src/openapi.rs

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,12 @@ mod tests {
521521
let manifest = build_plugin_manifest(&config, "https://vault.example.com");
522522
assert_eq!(manifest["schema_version"], "v1");
523523
assert_eq!(manifest["name_for_model"], "engraph");
524-
assert!(manifest["api"]["url"].as_str().unwrap().contains("openapi.json"));
524+
assert!(
525+
manifest["api"]["url"]
526+
.as_str()
527+
.unwrap()
528+
.contains("openapi.json")
529+
);
525530
}
526531

527532
#[test]
@@ -537,15 +542,35 @@ mod tests {
537542
}
538543
}
539544
let expected = vec![
540-
"healthCheck", "searchVault", "readNote", "readSection",
541-
"listNotes", "getVaultMap", "getWho", "getProject",
542-
"getContext", "getHealth", "createNote", "appendToNote",
543-
"editNote", "rewriteNote", "editFrontmatter", "moveNote",
544-
"archiveNote", "unarchiveNote", "updateMetadata", "deleteNote",
545-
"migratePreview", "migrateApply", "migrateUndo",
545+
"healthCheck",
546+
"searchVault",
547+
"readNote",
548+
"readSection",
549+
"listNotes",
550+
"getVaultMap",
551+
"getWho",
552+
"getProject",
553+
"getContext",
554+
"getHealth",
555+
"createNote",
556+
"appendToNote",
557+
"editNote",
558+
"rewriteNote",
559+
"editFrontmatter",
560+
"moveNote",
561+
"archiveNote",
562+
"unarchiveNote",
563+
"updateMetadata",
564+
"deleteNote",
565+
"migratePreview",
566+
"migrateApply",
567+
"migrateUndo",
546568
];
547569
for id in &expected {
548-
assert!(op_ids.contains(&id.to_string()), "Missing operationId: {id}");
570+
assert!(
571+
op_ids.contains(&id.to_string()),
572+
"Missing operationId: {id}"
573+
);
549574
}
550575
}
551576

0 commit comments

Comments
 (0)