burn icon indicating copy to clipboard operation
burn copied to clipboard

Use `AsRef<Path>` instead of `&str` for file operations

Open Colerar opened this issue 2 years ago • 2 comments

e.g.

https://github.com/burn-rs/burn/blob/fb2a71bb81e1a688b4cdae38729b24dd9361283f/burn-core/src/config.rs#L47

This allow caller pass PathBuf, String, &str and all types implemented AsRef<Path>, and it's API-compatible, it won't break any existing code.

Colerar avatar Aug 25 '23 19:08 Colerar

I agree.

Should we search all places where it's used, or do we know where it is used already?

antimora avatar Aug 28 '23 17:08 antimora

I think we should search for more usage, especially regarding saving configuration in JSON.

nathanielsimard avatar Aug 28 '23 20:08 nathanielsimard