Skip to content

Commit

Permalink
Change args order
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh authored and jfrolich committed Mar 7, 2024
1 parent 180c12a commit 8012191
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/build/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ use std::time::Instant;
fn remove_ast(package: &packages::Package, source_file: &str) {
let _ = std::fs::remove_file(helpers::get_compiler_asset(
package,
source_file,
&packages::Namespace::NoNamespace,
source_file,
"ast",
));
}

fn remove_iast(package: &packages::Package, source_file: &str) {
let _ = std::fs::remove_file(helpers::get_compiler_asset(
package,
source_file,
&packages::Namespace::NoNamespace,
source_file,
"iast",
));
}
Expand All @@ -38,14 +38,14 @@ fn remove_mjs_file(source_file: &str, suffix: &String) {
fn remove_compile_asset(package: &packages::Package, source_file: &str, extension: &str) {
let _ = std::fs::remove_file(helpers::get_compiler_asset(
package,
source_file,
&package.namespace,
source_file,
extension,
));
let _ = std::fs::remove_file(helpers::get_bs_compiler_asset(
source_file,
package,
&package.namespace,
source_file,
extension,
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/build/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ pub fn compile(
SourceType::SourceFile(source_file) => {
let cmi_path = helpers::get_compiler_asset(
package,
&source_file.implementation.path,
&package.namespace,
&source_file.implementation.path,
"cmi",
);

Expand Down
4 changes: 2 additions & 2 deletions src/build/packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ impl Package {
}

pub fn get_ast_path(&self, source_file: &str) -> String {
helpers::get_compiler_asset(self, source_file, &packages::Namespace::NoNamespace, "ast")
helpers::get_compiler_asset(self, &packages::Namespace::NoNamespace, source_file, "ast")
}

pub fn get_iast_path(&self, source_file: &str) -> String {
helpers::get_compiler_asset(self, source_file, &packages::Namespace::NoNamespace, "iast")
helpers::get_compiler_asset(self, &packages::Namespace::NoNamespace, source_file, "iast")
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ pub fn string_ends_with_any(s: &PathBuf, suffixes: &[&str]) -> bool {

pub fn get_compiler_asset(
package: &packages::Package,
source_file: &str,
namespace: &packages::Namespace,
source_file: &str,
extension: &str,
) -> String {
package.get_build_path()
Expand All @@ -190,9 +190,9 @@ pub fn canonicalize_string_path(path: &str) -> Option<String> {
}

pub fn get_bs_compiler_asset(
source_file: &str,
package: &packages::Package,
namespace: &packages::Namespace,
source_file: &str,
extension: &str,
) -> String {
let namespace = match extension {
Expand Down

0 comments on commit 8012191

Please sign in to comment.