Skip to content

Commit

Permalink
implement valuable for Path
Browse files Browse the repository at this point in the history
implement valuable for Path instead of &Path, in order to support
types like Box<Path>

Signed-off-by: Eliad Peller <[email protected]>
  • Loading branch information
eliad-wiz committed Mar 29, 2023
1 parent 1021649 commit 47e8fe5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/tests/ui/not_valuable.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
&T
&[T]
&mut T
&std::path::Path
&str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and $N others
= note: required for `Option<S>` to implement `Valuable`

Expand All @@ -31,11 +31,11 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
&T
&[T]
&mut T
&std::path::Path
&str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and $N others
= note: required for `Option<S>` to implement `Valuable`

Expand All @@ -52,11 +52,11 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
&T
&[T]
&mut T
&std::path::Path
&str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and $N others
= note: required for `Option<S>` to implement `Valuable`
= note: 1 redundant requirement hidden
Expand All @@ -75,11 +75,11 @@ error[E0277]: the trait bound `S: Valuable` is not satisfied
&T
&[T]
&mut T
&std::path::Path
&str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and $N others
= note: required for `Option<S>` to implement `Valuable`
= note: 1 redundant requirement hidden
Expand Down
2 changes: 1 addition & 1 deletion valuable/src/valuable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl Valuable for alloc::string::String {
}

#[cfg(feature = "std")]
impl Valuable for &std::path::Path {
impl Valuable for std::path::Path {
fn as_value(&self) -> Value<'_> {
Value::Path(self)
}
Expand Down

0 comments on commit 47e8fe5

Please sign in to comment.