Skip to content

Commit fcd8ee8

Browse files
drop the lints
Signed-off-by: Omar Mohamed <[email protected]>
1 parent c01e74d commit fcd8ee8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+865
-848
lines changed

packages/cli/src/build/assets.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//!
1313
//! We use the same lessons learned from the hot-patching engine which parses the binary file and its
1414
//! symbol table to find symbols that match the `__MANGANIS__` prefix. These symbols are ideally data
15-
//! symbols and contain the `BundledAsset` data type which implements `ConstSerialize` and `ConstDeserialize`.
15+
//! symbols and contain the BundledAsset data type which implements ConstSerialize and ConstDeserialize.
1616
//!
1717
//! When the binary is built, the `dioxus asset!()` macro will emit its metadata into the __MANGANIS__
1818
//! symbols, which we process here. After reading the metadata directly from the executable, we then
@@ -147,7 +147,7 @@ fn find_pdb_symbol_offsets(pdb_file: &Path) -> Result<Vec<u64>> {
147147
.get(rva.section as usize - 1)
148148
.expect("Section index out of bounds");
149149

150-
addresses.push(u64::from(section.pointer_to_raw_data + rva.offset));
150+
addresses.push((section.pointer_to_raw_data + rva.offset) as u64);
151151
}
152152
}
153153
Ok(addresses)
@@ -168,10 +168,9 @@ fn find_native_symbol_offsets<'a, R: ReadRef<'a>>(file: &File<'a, R>) -> Result<
168168
continue;
169169
};
170170
// Translate the section_relative_address to the file offset
171-
let section_relative_address: u64 = (i128::from(virtual_address)
172-
- i128::from(section.address()))
173-
.try_into()
174-
.expect("Virtual address should be greater than or equal to section address");
171+
let section_relative_address: u64 = (virtual_address as i128 - section.address() as i128)
172+
.try_into()
173+
.expect("Virtual address should be greater than or equal to section address");
175174
let file_offset = section_range_start + section_relative_address;
176175
offsets.push(file_offset);
177176
}
@@ -280,10 +279,10 @@ fn find_wasm_symbol_offsets<'a, R: ReadRef<'a>>(
280279
continue;
281280
};
282281

283-
let section_relative_address: u64 = (i128::from(virtual_address)
284-
- i128::from(main_memory_offset))
285-
.try_into()
286-
.expect("Virtual address should be greater than or equal to section address");
282+
let section_relative_address: u64 = ((virtual_address as i128)
283+
- main_memory_offset as i128)
284+
.try_into()
285+
.expect("Virtual address should be greater than or equal to section address");
287286
let file_offset = data_start_offset + section_relative_address;
288287

289288
offsets.push(file_offset);
@@ -294,7 +293,7 @@ fn find_wasm_symbol_offsets<'a, R: ReadRef<'a>>(
294293

295294
/// Find all assets in the given file, hash them, and write them back to the file.
296295
/// Then return an `AssetManifest` containing all the assets found in the file.
297-
pub async fn extract_assets_from_file(path: impl AsRef<Path>) -> Result<AssetManifest> {
296+
pub(crate) async fn extract_assets_from_file(path: impl AsRef<Path>) -> Result<AssetManifest> {
298297
let path = path.as_ref();
299298
let mut file = open_file_for_writing_with_timeout(
300299
path,

0 commit comments

Comments
 (0)