Skip to main content

format_suggestions

Function format_suggestions 

Source
pub fn format_suggestions(suggestions: &[Suggestion]) -> String
Expand description

Format suggestions into a user-friendly help message.

  • 0 suggestions: “help: No similar names found. List all sessions with: rec list”
  • 1 suggestion: “help: Did you mean ‘name’?”
  • 2 suggestions: “help: Did you mean ‘name1’ or ‘name2’?”
  • 3+ suggestions: “help: Did you mean ‘name1’, ‘name2’, or ‘name3’?”

§Panics

Panics if the suggestions slice is unexpectedly empty in the 3+ branch (cannot happen due to the match guard).