Skip to content

Commit fba2b69

Browse files
committed
Rename confusing function
1 parent a9df5e1 commit fba2b69

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

symbolic-debuginfo/src/sourcebundle.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -855,22 +855,18 @@ impl<'data> SourceBundleDebugSession<'data> {
855855
Ok(Some(source_content))
856856
}
857857

858-
/// File info by zip path.
859-
fn file_info_by_zip_path(&self, zip_path: &str) -> Option<&SourceFileInfo> {
860-
self.manifest.files.get(zip_path)
861-
}
862-
863-
fn lookup_source(
858+
/// Looks up a source file descriptor.
859+
fn get_source_file_descriptor(
864860
&self,
865861
key: FileKey,
866862
) -> Result<Option<SourceFileDescriptor<'_>>, SourceBundleError> {
867863
let zip_path = match self.indexed_files().get(&key) {
868-
Some(zip_path) => zip_path,
864+
Some(zip_path) => zip_path.as_str(),
869865
None => return Ok(None),
870866
};
871867

872868
let content = self.source_by_zip_path(zip_path)?;
873-
let info = self.file_info_by_zip_path(zip_path);
869+
let info = self.manifest.files.get(zip_path);
874870
Ok(content.map(|opt| SourceFileDescriptor::new_embedded(Cow::Owned(opt), info)))
875871
}
876872

@@ -879,15 +875,15 @@ impl<'data> SourceBundleDebugSession<'data> {
879875
&self,
880876
path: &str,
881877
) -> Result<Option<SourceFileDescriptor<'_>>, SourceBundleError> {
882-
self.lookup_source(FileKey::Path(path.into()))
878+
self.get_source_file_descriptor(FileKey::Path(path.into()))
883879
}
884880

885881
/// Like [`source_by_path`](Self::source_by_path) but looks up by URL.
886882
pub fn source_by_url(
887883
&self,
888884
url: &str,
889885
) -> Result<Option<SourceFileDescriptor<'_>>, SourceBundleError> {
890-
self.lookup_source(FileKey::Url(url.into()))
886+
self.get_source_file_descriptor(FileKey::Url(url.into()))
891887
}
892888

893889
/// Looks up some source by debug ID and file type.
@@ -908,7 +904,7 @@ impl<'data> SourceBundleDebugSession<'data> {
908904
debug_id: DebugId,
909905
ty: SourceFileType,
910906
) -> Result<Option<SourceFileDescriptor<'_>>, SourceBundleError> {
911-
self.lookup_source(FileKey::DebugId(debug_id, ty))
907+
self.get_source_file_descriptor(FileKey::DebugId(debug_id, ty))
912908
}
913909
}
914910

0 commit comments

Comments
 (0)