Skip to content

Commit b93c68b

Browse files
authored
Merge pull request #16 from dpaoliello/explicitlifetime
Add explicit lifetime parameters
2 parents e2103f2 + 04a5082 commit b93c68b

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ object = { version = "0.35.0", default-features = false, features = ["std", "rea
1717
cargo-binutils = "0.3.6"
1818
object = { version = "0.35.0", default-features = false, features = ["write", "xcoff"] }
1919
pretty_assertions = "1.4.0"
20+
21+
[lints.rust]
22+
rust_2018_idioms = { level = "deny" }

src/archive_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ fn write_symbol_table<W: Write + Seek>(
475475
fn write_symbol_map<W: Write + Seek>(
476476
w: &mut W,
477477
kind: ArchiveKind,
478-
members: &[MemberData],
478+
members: &[MemberData<'_>],
479479
sym_map: &SymMap,
480480
members_offset: u64,
481481
) -> io::Result<()> {

src/coff_import_file.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<'a> ObjectFactory<'a> {
246246
/// reference to the terminators and contains the library name (entry) for the
247247
/// import name table. It will force the linker to construct the necessary
248248
/// structure to import symbols from the DLL.
249-
fn create_import_descriptor(&self) -> Result<NewArchiveMember> {
249+
fn create_import_descriptor(&self) -> Result<NewArchiveMember<'_>> {
250250
let mut buffer = Vec::new();
251251

252252
const NUMBER_OF_SECTIONS: usize = 2;
@@ -460,7 +460,7 @@ impl<'a> ObjectFactory<'a> {
460460
/// Creates a NULL import descriptor. This is a small object file whcih
461461
/// contains a NULL import descriptor. It is used to terminate the imports
462462
/// from a specific DLL.
463-
fn create_null_import_descriptor(&self) -> Result<NewArchiveMember> {
463+
fn create_null_import_descriptor(&self) -> Result<NewArchiveMember<'_>> {
464464
let mut buffer = Vec::new();
465465

466466
const NUMBER_OF_SECTIONS: usize = 1;
@@ -542,7 +542,7 @@ impl<'a> ObjectFactory<'a> {
542542
/// Create a NULL Thunk Entry. This is a small object file which contains a
543543
/// NULL Import Address Table entry and a NULL Import Lookup Table Entry. It
544544
/// is used to terminate the IAT and ILT.
545-
fn create_null_thunk(&self) -> Result<NewArchiveMember> {
545+
fn create_null_thunk(&self) -> Result<NewArchiveMember<'_>> {
546546
let mut buffer = Vec::new();
547547

548548
const NUMBER_OF_SECTIONS: usize = 2;
@@ -658,7 +658,7 @@ impl<'a> ObjectFactory<'a> {
658658
name_type: ImportNameType,
659659
export_name: Option<&str>,
660660
machine: MachineTypes,
661-
) -> Result<NewArchiveMember> {
661+
) -> Result<NewArchiveMember<'_>> {
662662
let mut imp_size = self.import_name.len() + sym.len() + 2; // +2 for NULs
663663
if let Some(export_name) = export_name {
664664
imp_size += export_name.len() + 1;
@@ -704,7 +704,7 @@ impl<'a> ObjectFactory<'a> {
704704
weak: &str,
705705
imp: bool,
706706
machine: MachineTypes,
707-
) -> Result<NewArchiveMember> {
707+
) -> Result<NewArchiveMember<'_>> {
708708
let mut buffer = Vec::new();
709709
const NUMBER_OF_SECTIONS: usize = 1;
710710
const NUMBER_OF_SYMBOLS: usize = 5;

tests/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ where
367367
}
368368

369369
pub fn add_file_with_functions_to_object(
370-
object: &mut Object,
370+
object: &mut Object<'_>,
371371
file_name: &[u8],
372372
func_names: &[&[u8]],
373373
) {

0 commit comments

Comments
 (0)