tracel-ai / burn

Burn is a new comprehensive dynamic Deep Learning Framework built using Rust with extreme flexibility, compute efficiency and portability as its primary goals.
https://burn.dev
Apache License 2.0
8.45k stars 415 forks source link

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

Closed Colerar closed 23 hours ago

Colerar commented 1 year ago

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.

antimora commented 1 year ago

I agree.

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

nathanielsimard commented 1 year ago

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

ivnsch commented 6 days ago

I'll give this a go.

laggui commented 23 hours ago

Seems like this was completed in #699 and #1919