Hotfix: Nvidia module handling improved

This commit is contained in:
Luke D Jones
2021-03-10 10:15:59 +13:00
parent b05f680650
commit 7c2fb0be81
8 changed files with 29 additions and 38 deletions
-12
View File
@@ -6,13 +6,7 @@ use crate::error::RogError;
#[derive(Debug)]
pub enum GfxError {
ParseVendor,
Path(String, std::io::Error),
Read(String, std::io::Error),
Write(String, std::io::Error),
Module(String, std::io::Error),
Bus(String, std::io::Error),
Command(String, std::io::Error),
Modprobe(String),
DisplayManager(String),
}
@@ -21,13 +15,7 @@ impl fmt::Display for GfxError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
GfxError::ParseVendor => write!(f, "Could not parse vendor name"),
GfxError::Path(path, error) => write!(f, "Path {}: {}", path, error),
GfxError::Read(path, error) => write!(f, "Read {}: {}", path, error),
GfxError::Write(path, error) => write!(f, "Write {}: {}", path, error),
GfxError::Module(func, error) => write!(f, "Module error: {}: {}", func, error),
GfxError::Bus(func, error) => write!(f, "Bus error: {}: {}", func, error),
GfxError::Command(func, error) => write!(f, "Command exec error: {}: {}", func, error),
GfxError::Modprobe(detail) => write!(f, "Modprobe error: {}", detail),
GfxError::DisplayManager(detail) => write!(f, "Display manager: {}", detail),
}
}