You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new Array::sort_by_key doesn't seem to work when combined with the Value::as_* methods that the crate provides, like Value::as_str. Since I'm guessing that's the most common way to use that sorting function, I'd expect this test below to work, but it doesn't compile:
error[E0308]: mismatched types
--> crates/toml_edit/src/array.rs:433:9
|
433 | array.sort_by_key(Value::as_str);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected enum `Option<&str>`
found enum `Option<&str>`
note: the lifetime requirement is introduced here
--> crates/toml_edit/src/array.rs:327:29
|
327 | F: FnMut(&Value) -> K,
| ^
For more information about this error, try `rustc --explain E0308`.
The text was updated successfully, but these errors were encountered:
`Array::sort_by_key` can't really use a borrowed key because it will be
shuffling things around. As an alternative, we can just provide the
`cmp` to use.
Fixestoml-rs#639
The new
Array::sort_by_key
doesn't seem to work when combined with theValue::as_*
methods that the crate provides, likeValue::as_str
. Since I'm guessing that's the most common way to use that sorting function, I'd expect this test below to work, but it doesn't compile:Compilation error:
The text was updated successfully, but these errors were encountered: