(&self, f: &mut fmt::Formatter<'_>)
| 84 | |
| 85 | impl fmt::Display for RemoteError { |
| 86 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 87 | match self { |
| 88 | Self::AlreadyExists { name } => { |
| 89 | write!(f, "remote '{}' already exists", name) |
| 90 | } |
| 91 | Self::NotFound { name } => { |
| 92 | write!(f, "remote '{}' not found", name) |
| 93 | } |
| 94 | Self::InvalidName { name, reason } => { |
| 95 | write!(f, "invalid remote name '{}': {}", name, reason) |
| 96 | } |
| 97 | Self::InvalidUrl { url, reason } => { |
| 98 | write!(f, "invalid remote URL '{}': {}", url, reason) |
| 99 | } |
| 100 | Self::ReadError { path, source } => { |
| 101 | write!(f, "failed to read config '{}': {}", path, source) |
| 102 | } |
| 103 | Self::WriteError { path, source } => { |
| 104 | write!(f, "failed to write config '{}': {}", path, source) |
| 105 | } |
| 106 | Self::ParseError { path, message } => { |
| 107 | write!(f, "failed to parse config '{}': {}", path, message) |
| 108 | } |
| 109 | Self::SerializeError { message } => { |
| 110 | write!(f, "failed to serialize config: {}", message) |
| 111 | } |
| 112 | Self::CannotRemoveDefault { name } => { |
| 113 | write!( |
| 114 | f, |
| 115 | "cannot remove default remote '{}'; set another remote as default first", |
| 116 | name |
| 117 | ) |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | impl std::error::Error for RemoteError { |
nothing calls this directly
no outgoing calls
no test coverage detected