Skip to content

Commit a34d9b1

Browse files
refactor: update SymbolStr dereferencing
AFAICT these changes are required based on the changes `LocalInternedString` and `SymbolStr` in rust-lang/rust#65776
1 parent 73adbd3 commit a34d9b1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

rustfmt-core/rustfmt-lib/src/modules.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
154154
} else {
155155
// An internal module (`mod foo { /* ... */ }`);
156156
if let Some(path) = find_path_value(&item.attrs) {
157-
let path = Path::new(&path.as_str()).to_path_buf();
157+
let path = Path::new(&*path.as_str()).to_path_buf();
158158
Ok(Some(SubModKind::InternalWithPath(path)))
159159
} else {
160160
Ok(Some(SubModKind::Internal(item)))
@@ -288,7 +288,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
288288

289289
fn push_inline_mod_directory(&mut self, id: ast::Ident, attrs: &[ast::Attribute]) {
290290
if let Some(path) = find_path_value(attrs) {
291-
self.directory.path.push(&path.as_str());
291+
self.directory.path.push(&*path.as_str());
292292
self.directory.ownership = DirectoryOwnership::Owned { relative: None };
293293
} else {
294294
// We have to push on the current module name in the case of relative
@@ -300,10 +300,10 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
300300
if let DirectoryOwnership::Owned { relative } = &mut self.directory.ownership {
301301
if let Some(ident) = relative.take() {
302302
// remove the relative offset
303-
self.directory.path.push(ident.as_str());
303+
self.directory.path.push(&*ident.as_str());
304304
}
305305
}
306-
self.directory.path.push(&id.as_str());
306+
self.directory.path.push(&*id.as_str());
307307
}
308308
}
309309

rustfmt-core/rustfmt-lib/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ fn is_skip(meta_item: &MetaItem) -> bool {
242242
match meta_item.kind {
243243
MetaItemKind::Word => {
244244
let path_str = pprust::path_to_string(&meta_item.path);
245-
path_str == skip_annotation().as_str() || path_str == depr_skip_annotation().as_str()
245+
path_str == &*skip_annotation().as_str() || path_str == &*depr_skip_annotation().as_str()
246246
}
247247
MetaItemKind::List(ref l) => {
248248
meta_item.check_name(sym::cfg_attr) && l.len() == 2 && is_skip_nested(&l[1])

0 commit comments

Comments
 (0)