Fix false comment that crate does not support volume label in root dir

This commit is contained in:
Rafał Harabień 2019-07-17 14:45:07 +02:00
parent 9b4c3548dc
commit 35ebf03405

View File

@ -366,8 +366,8 @@ impl<T: ReadWriteSeek> FileSystem<T> {
/// Returns a volume label from BPB in the Boot Sector as `String`. /// Returns a volume label from BPB in the Boot Sector as `String`.
/// ///
/// Non-ASCII characters are replaced by the replacement character (U+FFFD). /// Non-ASCII characters are replaced by the replacement character (U+FFFD).
/// Note: File with `VOLUME_ID` attribute in root directory is ignored by this library. /// Note: This function returns label stored in the BPB structure. Use `read_volume_label_from_root_dir` to read
/// Only label from BPB is used. /// label from the root directory.
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
pub fn volume_label(&self) -> String { pub fn volume_label(&self) -> String {
// Decode volume label from OEM codepage // Decode volume label from OEM codepage
@ -380,8 +380,8 @@ impl<T: ReadWriteSeek> FileSystem<T> {
/// Returns a volume label from BPB in the Boot Sector as byte array slice. /// Returns a volume label from BPB in the Boot Sector as byte array slice.
/// ///
/// Label is encoded in the OEM codepage. /// Label is encoded in the OEM codepage.
/// Note: File with `VOLUME_ID` attribute in root directory is ignored by this library. /// Note: This function returns label stored in the BPB structure. Use `read_volume_label_from_root_dir_as_bytes`
/// Only label from BPB is used. /// to read label from the root directory.
pub fn volume_label_as_bytes(&self) -> &[u8] { pub fn volume_label_as_bytes(&self) -> &[u8] {
const PADDING: u8 = 0x20; const PADDING: u8 = 0x20;
let full_label_slice = &self.bpb.volume_label; let full_label_slice = &self.bpb.volume_label;