Skip to content

Commit

Permalink
Fix compilation issues when using hfe feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Jan 15, 2024
1 parent 37d815c commit 8eae94d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cpclib-disc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ pub mod edsk;
#[cfg(feature = "hfe")]
pub mod hfe;

#[cfg(feature = "hfe")]
use crate::hfe::Hfe;

use std::io::Read;
use std::path::Path;
use std::str::FromStr;
Expand Down Expand Up @@ -51,7 +54,7 @@ impl From<AmsdosError> for DskManagerError {

#[cfg(feature = "hfe")]
pub fn new_disc<P: AsRef<std::path::Path>>(path: Option<P>) -> Hfe {
let disc = Hfe::default();
Hfe::default()
}

#[cfg(not(feature = "hfe"))]
Expand All @@ -70,10 +73,8 @@ pub fn open_disc<P: AsRef<std::path::Path>>(path: P, fail_if_missing: bool) -> R
}
}

Hfe::open(disc_filename).map_err(|e| {
AssemblerError::AssemblingError {
msg: format!("Error while loading {e}")
}
Hfe::open(path).map_err(|e| {
format!("Error while loading {e}")
})
}

Expand Down

0 comments on commit 8eae94d

Please sign in to comment.