Compare commits

...

2 Commits

Author SHA1 Message Date
akadmin 670e7492bb Fix generate_from_template: correct return type and borrow handling
Continuous Integration / Test Suite (macos-latest, nightly) (push) Has been cancelled
Continuous Integration / Test Suite (macos-latest, stable) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, 1.70.0) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, beta) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, nightly) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, stable) (push) Has been cancelled
Continuous Integration / Test Suite (windows-latest, stable) (push) Has been cancelled
Continuous Integration / Security Audit (push) Has been cancelled
Continuous Integration / Code Coverage (push) Has been cancelled
Continuous Integration / Performance Benchmarks (push) Has been cancelled
Continuous Integration / Memory Safety Check (push) Has been cancelled
Continuous Integration / Docker Build Test (push) Has been cancelled
Continuous Integration / Release Readiness (push) Has been cancelled
Continuous Integration / Integration Tests (push) Has been cancelled
Continuous Integration / Stress Testing (push) Has been cancelled
Continuous Integration / Notify Results (push) Has been cancelled
2026-06-13 01:31:23 +00:00
akadmin a742efa73a Fix: remove unused mut on invoice_info table 2026-06-13 01:05:18 +00:00
2 changed files with 20 additions and 12 deletions
+1 -1
View File
@@ -478,7 +478,7 @@ impl AdvancedDocxHandler {
); );
// Invoice details table // Invoice details table
let mut invoice_info = Table::new(vec![]) let invoice_info = Table::new(vec![])
.add_row(TableRow::new(vec![ .add_row(TableRow::new(vec![
TableCell::new().add_paragraph(Paragraph::new().add_run(Run::new().add_text("Invoice #:"))), TableCell::new().add_paragraph(Paragraph::new().add_run(Run::new().add_text("Invoice #:"))),
TableCell::new().add_paragraph(Paragraph::new().add_run(Run::new().add_text("[INV-0001]"))), TableCell::new().add_paragraph(Paragraph::new().add_run(Run::new().add_text("[INV-0001]"))),
+19 -11
View File
@@ -1856,16 +1856,25 @@ impl DocxToolsProvider {
hint: Some("Check list_templates for available names".to_string()), hint: Some("Check list_templates for available names".to_string()),
} }
} else { } else {
// Open template
let mut handler = self.handler.write().unwrap(); let mut handler = self.handler.write().unwrap();
// Open template
let doc_id = match handler.open_document(&template_path) { let doc_id = match handler.open_document(&template_path) {
Ok(id) => id, Ok(id) => id,
Err(e) => { Err(e) => {
drop(handler); drop(handler);
return ToolOutcome::Error { return CallToolResponse {
code: ErrorCode::InternalError, content: vec![ToolResponseContent::Text(TextContent {
error: e.to_string(), content_type: "application/json".into(),
hint: None, text: serde_json::json!({
"success": false,
"error": e.to_string(),
"code": ErrorCode::InternalError
}).to_string(),
annotations: None,
})],
is_error: Some(true),
meta: None,
}; };
} }
}; };
@@ -1882,9 +1891,9 @@ impl DocxToolsProvider {
&doc_id, &doc_id,
&placeholder, &placeholder,
&val_str, &val_str,
false, // case_sensitive: false for placeholders false,
true, // whole_word: true (treat placeholder as whole token) true,
false, // use_regex: false false,
) { ) {
replace_count += count; replace_count += count;
} }
@@ -1892,9 +1901,8 @@ impl DocxToolsProvider {
// Save generated document // Save generated document
let out_path = PathBuf::from(output_path); let out_path = PathBuf::from(output_path);
let result = if out_path.parent().is_some() { let result = if let Some(parent) = out_path.parent() {
if let Err(e) = std::fs::create_dir_all(out_path.parent().unwrap()) { if let Err(e) = std::fs::create_dir_all(parent) {
drop(handler);
ToolOutcome::Error { ToolOutcome::Error {
code: ErrorCode::InternalError, code: ErrorCode::InternalError,
error: format!("Failed to create output directory: {}", e), error: format!("Failed to create output directory: {}", e),