Skip to content

Conversation

AlyAbdelmoneim
Copy link

Description

Renamed the script parameter to path (and scripts to paths) in the Rust port’s file loading functions for better naming consistency and clarity.
This change improves readability by making it clear that these functions load files from paths, not scripts in memory.

Fixes #586

Type of change

  • Refactor (non-breaking change that improves code clarity)

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have tested my code and verified that it compiles successfully.
  • I have run make clang-format and verified my code follows style guidelines.

let script_as_pathbuf = PathBuf::from(script.as_ref());
for path in paths.into_iter() {
let script_as_pathbuf = PathBuf::from(path.as_ref());
let script_as_str = script_as_pathbuf.to_str().unwrap();
Copy link
Contributor

@fahdfady fahdfady Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binding names like this are still irrelevant. script_as_str

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since I'm not so familiar with the functionality of this module I need to ask, should I rename all the variable names containing script or scripts to be path or paths ? or only inside the functions originally mentioned in the issue and their inline documentation (from_file, from single file) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only from_file from single file 👍

}

c_script = cstring_enum!(script_as_str, MetaCallLoaderError)?;
c_script = cstring_enum!(path_as_str, MetaCallLoaderError)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this from c_script to c_path

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, I keep missing those 😅

Copy link
Contributor

@fahdfady fahdfady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks Aly @AlyAbdelmoneim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust port: rename script to path for loading files

2 participants