Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/ports/rs_port/src/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use std::{
/// ```
pub fn from_single_file(
tag: impl ToString,
script: impl AsRef<Path>,
path: impl AsRef<Path>,
) -> Result<(), MetaCallLoaderError> {
from_file(tag, [script])
from_file(tag, [path])
}
/// Loads a script from file. Usage example: ...
/// ```
Expand All @@ -27,14 +27,14 @@ pub fn from_single_file(
/// ```
pub fn from_file(
tag: impl ToString,
scripts: impl IntoIterator<Item = impl AsRef<Path>>,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> Result<(), MetaCallLoaderError> {
let c_tag = cstring_enum!(tag, MetaCallLoaderError)?;
let mut c_script: CString;

let mut new_scripts: Vec<*const i8> = Vec::new();
for script in scripts.into_iter() {
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 👍


if !script_as_pathbuf.exists() {
Expand Down
Loading