5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2025-03-11 20:58:47 +03:00

prelude: drop OsStr implementation

this was leftover and not does not make sense with the current version of the
Prelude, which is an opaque blob of bytes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-06-10 13:35:17 +02:00
parent 032a7b235d
commit 60068f0391

View File

@ -720,24 +720,12 @@ pub struct Prelude {
pub data: Vec<u8>,
}
impl Prelude {
pub fn as_os_str(&self) -> &OsStr {
self.as_ref()
}
}
impl AsRef<[u8]> for Prelude {
fn as_ref(&self) -> &[u8] {
&self.data
}
}
impl AsRef<OsStr> for Prelude {
fn as_ref(&self) -> &OsStr {
OsStr::from_bytes(&self.data[..self.data.len().max(1) - 1])
}
}
#[cfg(all(test, target_os = "linux"))]
#[test]
fn test_linux_devices() {