#Code review for Rush (shell project)

15 messages · Page 1 of 1 (latest)

wise glade
#

something i would look at is the use of

            fs::read_dir(&absolute_path).map_err(|_| {
                eprintln!(
                    "Failed to read directory: '{}'",
                    absolute_path.to_string_lossy().to_string()
                );
                InternalCommandError::FailedToRun
            })?
#

.map_err is usually seen to be something that takes in a pure function to transform error types

#

i would add something like this to the InternalCommandError

    #[error("command failed: {0}")]
    CommandFailed(String),
wise glade
#

mistyped

earnest gazelle
wise glade
#

it refers to the String in CommandFailed(String)

#

so if you supply a string to that error it gets added to the error message

rough berry
#

Not really a code review but a heads up, you’re using regular comment in place of doc comment a fair bit!

earnest gazelle
#

It makes those highlight in red

#

Though I can (probably?) change it to not conflict with doc comments