From c1dbea197a6ba7e3d008e01c8169f5c3702151ea Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 11 Feb 2026 17:56:26 -0800 Subject: [Rust] Refactor `FileMetadata` file information - Rename and retype `FileMetadata::filename` and make the assignment required to happen at time of construction. - Add `FileMetadata::display_name` which is only to be used for presentation purposes. - Add `FileMetadata::virtual_path` for containers. - Rename `FileMetadata::modified` to `FileMetadata::is_modified` to be more consistent across codebase. - Add some missing documentation. - Add `BinaryView::from_metadata` with accompanying documentation. --- plugins/idb_import/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins/idb_import/src') diff --git a/plugins/idb_import/src/lib.rs b/plugins/idb_import/src/lib.rs index f285f554..0137f198 100644 --- a/plugins/idb_import/src/lib.rs +++ b/plugins/idb_import/src/lib.rs @@ -27,8 +27,10 @@ impl CustomDebugInfoParser for IDBDebugInfoParser { project_file.name().as_str().ends_with(".i64") || project_file.name().as_str().ends_with(".idb") } else { - view.file().filename().as_str().ends_with(".i64") - || view.file().filename().as_str().ends_with(".idb") + view.file() + .file_path() + .extension() + .map_or(false, |ext| ext == "i64" || ext == "idb") } } @@ -55,7 +57,10 @@ impl CustomDebugInfoParser for TILDebugInfoParser { if let Some(project_file) = view.file().project_file() { project_file.name().as_str().ends_with(".til") } else { - view.file().filename().as_str().ends_with(".til") + view.file() + .file_path() + .extension() + .map_or(false, |ext| ext == "til") } } -- cgit v1.3.1