Переглянути джерело

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<_>>(),
         })
     }
 }