mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
internal: Arc<String> -> Arc<str>
This commit is contained in:
parent
63e3bf118d
commit
f00dcf9a69
16 changed files with 34 additions and 36 deletions
|
@ -15,7 +15,7 @@ fn check_def_map_is_not_recomputed(ra_fixture_initial: &str, ra_fixture_change:
|
|||
});
|
||||
assert!(format!("{events:?}").contains("crate_def_map"), "{events:#?}")
|
||||
}
|
||||
db.set_file_text(pos.file_id, Arc::new(ra_fixture_change.to_string()));
|
||||
db.set_file_text(pos.file_id, Arc::from(ra_fixture_change));
|
||||
|
||||
{
|
||||
let events = db.log_executed(|| {
|
||||
|
@ -96,7 +96,7 @@ fn typing_inside_a_macro_should_not_invalidate_def_map() {
|
|||
});
|
||||
assert!(format!("{events:?}").contains("crate_def_map"), "{events:#?}")
|
||||
}
|
||||
db.set_file_text(pos.file_id, Arc::new("m!(Y);".to_string()));
|
||||
db.set_file_text(pos.file_id, Arc::from("m!(Y);"));
|
||||
|
||||
{
|
||||
let events = db.log_executed(|| {
|
||||
|
@ -150,7 +150,7 @@ fn quux() { 92 }
|
|||
m!(Y);
|
||||
m!(Z);
|
||||
"#;
|
||||
db.set_file_text(pos.file_id, Arc::new(new_text.to_string()));
|
||||
db.set_file_text(pos.file_id, Arc::from(new_text));
|
||||
|
||||
{
|
||||
let events = db.log_executed(|| {
|
||||
|
|
|
@ -71,7 +71,7 @@ impl fmt::Debug for TestDB {
|
|||
impl panic::RefUnwindSafe for TestDB {}
|
||||
|
||||
impl FileLoader for TestDB {
|
||||
fn file_text(&self, file_id: FileId) -> Arc<String> {
|
||||
fn file_text(&self, file_id: FileId) -> Arc<str> {
|
||||
FileLoaderDelegate(self).file_text(file_id)
|
||||
}
|
||||
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue