Skip to content

Commit

Permalink
More refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Dec 5, 2023
1 parent ad76d78 commit c95469b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Code/itf/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl TraceGenerator {

cmd.arg(self.spec_path.as_os_str());

println!("Generating traces...");
println!("Generating traces from '{}'...", self.spec_path.display());

cmd.current_dir(self.spec_path.parent().unwrap())
.output()
Expand All @@ -47,15 +47,16 @@ impl TraceGenerator {

/// Remove traces from imported modules
fn remove_imported_traces(&self) {
for redundant_itf in glob(&format!(
let redundant_itfs = glob(&format!(
"{}/*{}::*.*",
self.gen_dir.display(),
self.spec_path.file_stem().unwrap().to_str().unwrap()
self.spec_path.file_stem().and_then(|s| s.to_str()).unwrap()
))
.expect("Failed to read glob pattern")
.flatten()
{
std::fs::remove_file(&redundant_itf).unwrap();
.flatten();

for redundant_itf in redundant_itfs {
std::fs::remove_file(&redundant_itf).expect("Failed to remove redundant ITF file");
}
}

Expand Down Expand Up @@ -159,7 +160,9 @@ impl TraceGeneratorBuilder {
pub fn build(self) -> TraceGenerator {
let spec_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../Specs/Quint")
.join(self.spec_rel_path);
.join(self.spec_rel_path)
.canonicalize()
.expect("Failed to canonicalize spec path");

TraceGenerator {
spec_path,
Expand Down

0 comments on commit c95469b

Please sign in to comment.