Use qualified_name terminology in more structs for consistency (#4873)

This commit is contained in:
Charlie Marsh 2023-06-05 15:06:48 -04:00 committed by GitHub
parent 33434fcb9c
commit 8938b2d555
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 116 additions and 105 deletions

View file

@ -800,7 +800,7 @@ pub fn format_import_from(level: Option<u32>, module: Option<&str>) -> String {
/// assert_eq!(format_import_from_member(Some(1), Some("foo"), "bar"), ".foo.bar".to_string());
/// ```
pub fn format_import_from_member(level: Option<u32>, module: Option<&str>, member: &str) -> String {
let mut full_name = String::with_capacity(
let mut qualified_name = String::with_capacity(
(level.unwrap_or(0) as usize)
+ module.as_ref().map_or(0, |module| module.len())
+ 1
@ -808,15 +808,15 @@ pub fn format_import_from_member(level: Option<u32>, module: Option<&str>, membe
);
if let Some(level) = level {
for _ in 0..level {
full_name.push('.');
qualified_name.push('.');
}
}
if let Some(module) = module {
full_name.push_str(module);
full_name.push('.');
qualified_name.push_str(module);
qualified_name.push('.');
}
full_name.push_str(member);
full_name
qualified_name.push_str(member);
qualified_name
}
/// Create a module path from a (package, path) pair.