sys crate (#583)

Fix #508.
This commit is contained in:
Yota Toyama authored and GitHub committed 2026-09-26 03:43:48 +00:00
1 parent 82135e07a7
commit 2f26b40e30
21 files changed
+436 -80

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
use core::{
error,
fmt::{self, Display, Formatter},
};
#[derive(Debug)]
pub struct Error {
description: &'static str,
}
impl Error {
pub const fn new(description: &'static str) -> Error {
Error { description }
}
}
impl Display for Error {
fn fmt(&self, formatter: &mut Formatter) -> fmt::Result {
write!(formatter, "{}", self.description)
}
}
impl error::Error for Error {
fn description(&self) -> &str {
self.description
}
}