Grasscutters / Cultivation

A custom launcher designed to make it as easy as possible to proxy anime game traffic to private servers.
Apache License 2.0
984 stars 164 forks source link

Refactor path concatenation and make error handling src-tauri/src/lang.rs #143

Closed ariqpradipa closed 1 year ago

ariqpradipa commented 1 year ago

I think we can use join() method on the PathBuf directly to concatenate the segments, this will make the code more short and easier to read.

And instead of using unwrap() on the file_name() and to_str() methods, we can use unwrap_or_else() to provide a default value or an error handler function, this should prevent panics.