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

The changes were mostly automatically applied using the Python
script mentioned in the first commit of this series.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster 2025-05-21 12:31:55 +02:00 committed by Rob Bradford
parent 2100d8c30f
commit 8f56de713b
2 changed files with 6 additions and 6 deletions

View file

@ -23,23 +23,23 @@ pub enum Error {
ThreadSpawn(#[source] io::Error),
/// Cannot create epoll context.
#[error("Error creating epoll context: {0}")]
#[error("Error creating epoll context")]
Epoll(#[source] io::Error),
/// Cannot create EventFd.
#[error("Error creating EventFd: {0}")]
#[error("Error creating EventFd")]
EventFd(#[source] io::Error),
/// Cannot create RateLimiter.
#[error("Error creating RateLimiter: {0}")]
#[error("Error creating RateLimiter")]
RateLimiter(#[source] io::Error),
/// Cannot read from EventFd.
#[error("Error reading from EventFd: {0}")]
#[error("Error reading from EventFd")]
EventFdRead(#[source] io::Error),
/// Cannot write to EventFd.
#[error("Error writing to EventFd: {0}")]
#[error("Error writing to EventFd")]
EventFdWrite(#[source] io::Error),
}

View file

@ -65,7 +65,7 @@ pub enum Error {
#[error("Event handler was called spuriously: {0}")]
SpuriousRateLimiterEvent(&'static str),
/// The event handler encounters while TimerFd::wait()
#[error("Failed to wait for the timer: {0}")]
#[error("Failed to wait for the timer")]
TimerFdWaitError(#[source] std::io::Error),
}