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

Add test for #10618 and #16382 #16697

Closed
wants to merge 1 commit into from
Closed

Conversation

Sawyer47
Copy link
Contributor

Closes #10618
Closes #16382

bors added a commit that referenced this pull request Aug 23, 2014
bors added a commit that referenced this pull request Aug 24, 2014
@bors bors closed this Aug 24, 2014
@Sawyer47 Sawyer47 deleted the new-test branch August 24, 2014 06:02
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2024
…eykril

Add `to_path_buf()` method for `RelPath`

There seems to be no ergonomic way to obtain a `RelPathBuf` from a corresponding `&RelPath` at the moment, making the latter sort of a dead end.

The `AbsPath` type provides the following:

```rust
impl AbsPath {
    // ...

    /// Equivalent of [`Path::to_path_buf`] for `AbsPath`.
    pub fn to_path_buf(&self) -> AbsPathBuf {
        AbsPathBuf::try_from(self.0.to_path_buf()).unwrap()
    }

    // ...
}
```

So I took the liberty of adding a corresponding equivalent for `RelPath:

```rust
impl RelPath {
    // ...

    /// Equivalent of [`Path::to_path_buf`] for `RelPath`.
    pub fn to_path_buf(&self) -> RelPathBuf {
        RelPathBuf::try_from(self.0.to_path_buf()).unwrap()
    }

    // ...
}
```

(the change is motivated by an outside use of the `ra_ap_paths` crate that would benefit from being able to use `RelPath` and `AbsPath` over `Path`)
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.

ICE when initiating an array using static for size ICE with cast in fixed-length vector
4 participants