【发布时间】:2018-05-23 07:21:43
【问题描述】:
从&Result 类型中提取数据的好方法是什么?
在我的特定情况下,我有一个 &Result<DirEntry, Error> 类型,我无法打开它,因为我不拥有该对象。我试图取消引用并克隆它(*left_item).clone(),但这只会给我一个注释错误:
the method `clone` exists but the following trait bounds were not satisfied:
`std::result::Result<std::fs::DirEntry, std::io::Error> : std::clone::Clone`
【问题讨论】:
标签: rust