Method
with_suggestions
(msg: impl Into<String>, suggestions: &[String])
Source from the content-addressed store, hash-verified
| 735 | |
| 736 | impl ToolError { |
| 737 | pub fn with_suggestions(msg: impl Into<String>, suggestions: &[String]) -> Self { |
| 738 | let msg = msg.into(); |
| 739 | if suggestions.is_empty() { |
| 740 | ToolError::FileNotFound(msg) |
| 741 | } else { |
| 742 | ToolError::FileNotFound(format!( |
| 743 | "{}\n\nDid you mean one of these?\n{}", |
| 744 | msg, |
| 745 | suggestions.join("\n") |
| 746 | )) |
| 747 | } |
| 748 | } |
| 749 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected