Skip to content

Accept AsRef<Path> instead of PathBuf to mirror std#6

Merged
davidv1992 merged 1 commit into
pendulum-project:mainfrom
Erk-:use-asref-path-instead-of-pathbuf
Jun 11, 2026
Merged

Accept AsRef<Path> instead of PathBuf to mirror std#6
davidv1992 merged 1 commit into
pendulum-project:mainfrom
Erk-:use-asref-path-instead-of-pathbuf

Conversation

@Erk-

@Erk- Erk- commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This is a breaking change, but I think it will make the API nicer and more efficient since you no longer need to pass a owned string to the new method.

For reference the std library does it in the same way: https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.open

This change will mean that you can do the following:

PpsDevice::new("/dev/pps0")?;

@davidv1992 davidv1992 merged commit 6242259 into pendulum-project:main Jun 11, 2026
1 check passed
@Erk- Erk- deleted the use-asref-path-instead-of-pathbuf branch June 11, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants