Skip to content

Commit

Permalink
Merge pull request #16 from dpaoliello/explicitlifetime
Browse files Browse the repository at this point in the history
Add explicit lifetime parameters
  • Loading branch information
bjorn3 authored Jul 31, 2024
2 parents e2103f2 + 04a5082 commit b93c68b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ object = { version = "0.35.0", default-features = false, features = ["std", "rea
cargo-binutils = "0.3.6"
object = { version = "0.35.0", default-features = false, features = ["write", "xcoff"] }
pretty_assertions = "1.4.0"

[lints.rust]
rust_2018_idioms = { level = "deny" }
2 changes: 1 addition & 1 deletion src/archive_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ fn write_symbol_table<W: Write + Seek>(
fn write_symbol_map<W: Write + Seek>(
w: &mut W,
kind: ArchiveKind,
members: &[MemberData],
members: &[MemberData<'_>],
sym_map: &SymMap,
members_offset: u64,
) -> io::Result<()> {
Expand Down
10 changes: 5 additions & 5 deletions src/coff_import_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl<'a> ObjectFactory<'a> {
/// reference to the terminators and contains the library name (entry) for the
/// import name table. It will force the linker to construct the necessary
/// structure to import symbols from the DLL.
fn create_import_descriptor(&self) -> Result<NewArchiveMember> {
fn create_import_descriptor(&self) -> Result<NewArchiveMember<'_>> {
let mut buffer = Vec::new();

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

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

const NUMBER_OF_SECTIONS: usize = 2;
Expand Down Expand Up @@ -658,7 +658,7 @@ impl<'a> ObjectFactory<'a> {
name_type: ImportNameType,
export_name: Option<&str>,
machine: MachineTypes,
) -> Result<NewArchiveMember> {
) -> Result<NewArchiveMember<'_>> {
let mut imp_size = self.import_name.len() + sym.len() + 2; // +2 for NULs
if let Some(export_name) = export_name {
imp_size += export_name.len() + 1;
Expand Down Expand Up @@ -704,7 +704,7 @@ impl<'a> ObjectFactory<'a> {
weak: &str,
imp: bool,
machine: MachineTypes,
) -> Result<NewArchiveMember> {
) -> Result<NewArchiveMember<'_>> {
let mut buffer = Vec::new();
const NUMBER_OF_SECTIONS: usize = 1;
const NUMBER_OF_SYMBOLS: usize = 5;
Expand Down
2 changes: 1 addition & 1 deletion tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ where
}

pub fn add_file_with_functions_to_object(
object: &mut Object,
object: &mut Object<'_>,
file_name: &[u8],
func_names: &[&[u8]],
) {
Expand Down

0 comments on commit b93c68b

Please sign in to comment.