MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / require_view

Function require_view

atomic-cli/src/commands/triage/mod.rs:431–437  ·  view source on GitHub ↗

Fail with an actionable message when a triage view argument names a view that does not exist. The usual cause is typing the placeholder from the help text (`atomic triage review feature`) instead of a real view name, so the message says the argument is optional and names the current view as the value to simply drop in — or the value to leave off entirely.

(repo: &Repository, name: &str, arg: &str)

Source from the content-addressed store, hash-verified

429/// says the argument is optional and names the current view as the value to
430/// simply drop in — or the value to leave off entirely.
431fn require_view(repo: &Repository, name: &str, arg: &str) -> CliResult<()> {
432 if repo.view_exists(name).map_err(CliError::Repository)? {
433 Ok(())
434 } else {
435 Err(unknown_view(repo, name, arg))
436 }
437}
438
439/// The error for a view name that does not resolve.
440fn unknown_view(repo: &Repository, name: &str, arg: &str) -> CliError {

Callers 1

resolve_viewsFunction · 0.85

Calls 2

unknown_viewFunction · 0.85
view_existsMethod · 0.80

Tested by

no test coverage detected