(path: &Path)
| 208 | } |
| 209 | |
| 210 | pub(crate) fn read_sysfs_trimmed(path: &Path) -> Result<String, VfioError> { |
| 211 | fs::read_to_string(path) |
| 212 | .map(|s| s.trim().to_string()) |
| 213 | .map_err(|source| VfioError::SysfsIo { |
| 214 | path: path.display().to_string(), |
| 215 | source, |
| 216 | }) |
| 217 | } |
| 218 | |
| 219 | pub(crate) fn write_sysfs(path: &Path, value: &str) -> Result<(), VfioError> { |
| 220 | fs::write(path, value).map_err(|source| VfioError::SysfsIo { |