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
let mut invoice_info = Table::new(vec![])
let invoice_info = Table::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("[INV-0001]"))),
+19 -11
View File
@@ -1856,16 +1856,25 @@ impl DocxToolsProvider {
hint: Some("Check list_templates for available names".to_string()),
}
} else {
// Open template
let mut handler = self.handler.write().unwrap();
// Open template
let doc_id = match handler.open_document(&template_path) {
Ok(id) => id,
Err(e) => {
drop(handler);
return ToolOutcome::Error {
code: ErrorCode::InternalError,
error: e.to_string(),
hint: None,
return CallToolResponse {
content: vec![ToolResponseContent::Text(TextContent {
content_type: "application/json".into(),
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,
&placeholder,
&val_str,
false, // case_sensitive: false for placeholders
true, // whole_word: true (treat placeholder as whole token)
false, // use_regex: false
false,
true,
false,
) {
replace_count += count;
}
@@ -1892,9 +1901,8 @@ impl DocxToolsProvider {
// Save generated document
let out_path = PathBuf::from(output_path);
let result = if out_path.parent().is_some() {
if let Err(e) = std::fs::create_dir_all(out_path.parent().unwrap()) {
drop(handler);
let result = if let Some(parent) = out_path.parent() {
if let Err(e) = std::fs::create_dir_all(parent) {
ToolOutcome::Error {
code: ErrorCode::InternalError,
error: format!("Failed to create output directory: {}", e),