forked from proxmox-mirrors/proxmox
client: fix code-style issue when formatting error
Fixes a style issue introduced by b31ab119
("client: improve api error
message (avoid duplicate status code)"), as one always should use
inline variables for format template strings even if there are some
that cannot be used, e.g. as some method needs to be called on them
like here. The reason for this is to reduce the amount of
free-standing "{}" and parameters as that reduces the need to manually
match what "{}" resolves to which expression. While it is not that bad
for only two format variables it's still not winning us anything if we
don't do it and breaks consistency with newer code style.
Noticed as that commit made the line overly long, causing rustfmt
changing the line.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
daff73bdd6
commit
0477adaf88
@ -53,7 +53,7 @@ impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
Self::Unauthorized => f.write_str("unauthorized"),
|
||||
Self::Api(status, msg) => write!(f, "api error (status = {}: {})", status.as_u16(), msg),
|
||||
Self::Api(status, msg) => write!(f, "api error (status = {}: {msg})", status.as_u16()),
|
||||
Self::UnexpectedData => write!(f, "api unexpectedly returned data"),
|
||||
Self::BadApi(msg, _) => write!(f, "api returned unexpected data - {msg}"),
|
||||
Self::Other(err) => f.write_str(err),
|
||||
|
Loading…
Reference in New Issue
Block a user