Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PathBuf cleanup #1372

@stacksjb

Description

@stacksjb

See feedback here

[nitpick] Consider accepting a generic path parameter (e.g., impl AsRef or &Path) instead of &PathBuf to follow Rust conventions and improve flexibility.
pub async fn load(path: &PathBuf) -> Result<Config, Error> {
src/main.rs:79

[nitpick] The doc comment still refers to a String; update it to clarify that the field is now a PathBuf.
/// Absolute path of configuration. Defaults to $XDG_CONFIG_HOME/tod.cfg
src/config.rs:664

[nitpick] Rather than panicking with expect, consider propagating a descriptive Error so that library code doesn’t unwind unexpectedly in production.
let config_directory = dirs::config_dir().expect("Could not find config directory");

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions