misc: vmm: streamline error Display::fmt()

The changes were mostly automatically applied using the following
Python script:

```python
import os, re

for root, _, files in os.walk("."):
    for f in files:
        if not f.endswith(".rs"):
            continue
        p = os.path.join(root, f)
        with open(p, "r", encoding="utf-8") as file:
            lines = file.readlines()
        changed = False
        for i in range(len(lines) - 1):
            if re.search(r'#\[error\(".*: \{0[^}]*\}"\)\]', lines[i]) and "#[source]" in lines[i + 1].strip():
                lines[i] = re.sub(r': \{0[^}]*\}"\)\]', '")]', lines[i])
                changed = True
        if changed:
            with open(p, "w", encoding="utf-8") as file:
                file.writelines(lines)
            print("Fixed:", p)
```

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

# Conflicts:
#	vmm/src/api/http/mod.rs
This commit is contained in:
Philipp Schuster
2025-05-21 12:30:47 +02:00
committed by Rob Bradford
parent 4987d63b6a
commit d7edd9d51f
13 changed files with 281 additions and 280 deletions

View File

@@ -33,7 +33,7 @@ const TIOCGPTPEER: libc::c_int = 0x5441;
#[derive(Debug, Error)]
pub enum ConsoleDeviceError {
/// Error creating console device
#[error("Error creating console device: {0}")]
#[error("Error creating console device")]
CreateConsoleDevice(#[source] io::Error),
/// No socket option support for console device
@@ -41,15 +41,15 @@ pub enum ConsoleDeviceError {
NoSocketOptionSupportForConsoleDevice,
/// Error setting pty raw mode
#[error("Error setting pty raw mode: {0}")]
#[error("Error setting pty raw mode")]
SetPtyRaw(#[source] vmm_sys_util::errno::Error),
/// Cannot duplicate file descriptor
#[error("Cannot duplicate file descriptor: {0}")]
#[error("Cannot duplicate file descriptor")]
DupFd(#[source] vmm_sys_util::errno::Error),
/// Error starting sigwinch listener
#[error("Error starting sigwinch listener: {0}")]
#[error("Error starting sigwinch listener")]
StartSigwinchListener(#[source] std::io::Error),
}