#CLI executable - first rust app - would like a review to get a sense if i'm in the right direction

10 messages · Page 1 of 1 (latest)

hollow temple
#

hey all,

i'm a very experienced developer but new to rust. I'm a ways into a cli app i'm building, and would appreciate if anyone would mind taking a look and offering a code-review, so i can figure out if i'm sorta 'doing it right', especially in picking up the idioms. While the code works, it may not quite be the 'rust way' so i want to get that right.

heads up that there are no tests yet... still moving code around and getting the pattern down before committing to tests.

https://github.com/imajes/f1fs is the repo. i wish you could open a PR for review of main, but feedback here/there/issues/dm whatever is perfect. thank you!!

GitHub

a file manager for ensuring imported files are arranged as per their needs - GitHub - imajes/f1fs: a file manager for ensuring imported files are arranged as per their needs

visual smelt
#

u could use a logging lib

#

oh u do but not in main

#
let _output = match year {
   year => process_year(year, dest)?,
};
```this looks funky. does the match here do anyth lol
#

if u have a GenerateResult<bool> but always return Ok(true) u could just do a GenerateResult<()> and return an Ok(())

#

and an error lib like anyhow + thiserror is a better solution

#

u can also clean up ur cargo.toml and remove unused stuff

#

eg getopts

#

code looks pretty clean

#

i think ur using references too much