瀏覽代碼

aya: section: collecting relocations can't fail anymore

Alessandro Decina 4 年之前
父節點
當前提交
8b0eee317d
共有 1 個文件被更改,包括 6 次插入8 次删除
  1. 6 8
      aya/src/obj/mod.rs

+ 6 - 8
aya/src/obj/mod.rs

@@ -268,15 +268,13 @@ impl<'data, 'file, 'a> TryFrom<&'a ObjSection<'data, 'file>> for Section<'a> {
             data: section.data().map_err(map_err)?,
             relocations: section
                 .relocations()
-                .map(|(offset, r)| {
-                    Ok::<_, ParseError>(Relocation {
-                        kind: r.kind(),
-                        target: r.target(),
-                        addend: r.addend(),
-                        offset,
-                    })
+                .map(|(offset, r)| Relocation {
+                    kind: r.kind(),
+                    target: r.target(),
+                    addend: r.addend(),
+                    offset,
                 })
-                .collect::<Result<Vec<_>, _>>()?,
+                .collect::<Vec<_>>(),
         })
     }
 }