这里有什么问题:
fn main() {
let word: &str = "lowks";
assert_eq!(word.chars().rev(), "skwol");
}
我遇到了这样的错误:
error[E0369]: binary operation `==` cannot be applied to type `std::iter::Rev<std::str::Chars<'_>>`
--> src/main.rs:4:5
|
4 | assert_eq!(word.chars().rev(), "skwol");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: an implementation of `std::cmp::PartialEq` might be missing for `std::iter::Rev<std::str::Chars<'_>>`
= note: this error originates in a macro outside of the current crate
如何正确地执行此操作?
"Åström"
方面完全失败了。 - Shepmasterchars()
函数可以使用"Åström"
。至少我看到的输出是m̈orts̊A
。不确定稳定版是否最近更新以支持此功能。 - MilesFÅs
vss̊A
/öm
vsm̈o
- Shepmasterrev
不能再被调用于Chars
上了吗? - theonlygusti