mirror of
https://github.com/Zenithsiz/dcb.git
synced 2026-02-06 01:20:11 +00:00
Added without_version to iso9660 file strings to get the filename without anything else.
This commit is contained in:
parent
bf5e43a163
commit
a3fdbe5f7b
@ -177,5 +177,18 @@ pub type FileStrArr<const N: usize> = StrArrAlphabet<FileAlphabet, N>;
|
||||
/// File string
|
||||
pub type FileString = StringAlphabet<FileAlphabet>;
|
||||
|
||||
impl FileStr {
|
||||
/// Returns this filename without the version
|
||||
#[must_use]
|
||||
pub fn without_version(&self) -> &str {
|
||||
let s = std::str::from_utf8(self.as_bytes()).expect("File string had invalid utf8 characters");
|
||||
|
||||
match s.split_once(';') {
|
||||
Some((s, _)) => s,
|
||||
None => s,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// File string slice
|
||||
pub type FileStr = StrAlphabet<FileAlphabet>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user