Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax Path parameter to impl AsRef<Path> #71

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

soerenmeier
Copy link
Collaborator

When trying to store GptDisk in a struct which was created from a Path the following error occurs.

error[E0597]: `path` does not live long enough
   --> src/main.rs:240:10
    |
238 |           let disk = GptConfig::new()
    |  ____________________-
239 | |             .writable(false)
240 | |             .open(&path)?;
    | |___________________^^^^^- argument requires that `path` is borrowed for `'static`
    |                     |
    |                     borrowed value does not live long enough
...
243 |       }
    |       - `path` dropped here while still borrowed

Making GptDisk<'static> the return type fixes this.

Additionally i propose to update the parameter Path to also accept a str like the std library does.

@Quyzi Quyzi merged commit b6861d0 into Quyzi:master Sep 15, 2021
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