Skip to content

Commit 7054f56

Browse files
committed
2024 edition fixes
1 parent 840dda6 commit 7054f56

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ version = "0.2.0"
44
edition = "2021"
55
authors = ["Kyle Sabo"]
66
description = "Find a resource from a PE image without loading it."
7+
# 1.82 adds use<>, which is required to make the code also compile with edition 2024 (1.85+)
8+
rust-version = "1.82"
79

810
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
911

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ mod rsrc {
101101
}
102102
}
103103

104-
pub fn chars(&self) -> impl Iterator<Item = char> + 'a {
104+
pub fn chars(&self) -> impl Iterator<Item = char> + use<'a> {
105105
char::decode_utf16(self.buf.iter().copied())
106106
.map(|r| r.unwrap_or(char::REPLACEMENT_CHARACTER))
107107
.fuse()
@@ -218,7 +218,7 @@ pub mod parser {
218218
impl<'a> ImageResource<'a> {
219219
// Win32 FindResourceW
220220
// Wrapper around ImageResourceEntry::find that returns only the buffer slice for the found resource
221-
pub fn find<T, U>(&'a self, name: &T, id: &U) -> Result<ResourceData, PEError>
221+
pub fn find<T, U>(&'a self, name: &T, id: &U) -> Result<ResourceData<'a>, PEError>
222222
where
223223
ResourceIdType<'a>: PartialEq<T>,
224224
ResourceIdType<'a>: PartialEq<U>,
@@ -235,7 +235,7 @@ pub mod parser {
235235
pub fn to_chars<'x>(
236236
&'a self,
237237
resource_id: ResourceIdType<'a>,
238-
) -> impl Iterator<Item = char> + 'x
238+
) -> impl Iterator<Item = char> + use<'a>
239239
where
240240
'a: 'x,
241241
{

0 commit comments

Comments
 (0)