From 20b1a38414101f842a6d9201133a5aaaa45a7cec Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 31 Jan 2022 16:06:44 +0100 Subject: Switch from `Rc` to `Arc` --- src/source.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/source.rs') diff --git a/src/source.rs b/src/source.rs index fd42c3f7..0e7b4c63 100644 --- a/src/source.rs +++ b/src/source.rs @@ -4,7 +4,7 @@ use std::collections::HashMap; use std::io; use std::ops::Range; use std::path::{Path, PathBuf}; -use std::rc::Rc; +use std::sync::Arc; use crate::diag::TypResult; use crate::loading::{FileHash, Loader}; @@ -37,14 +37,14 @@ impl SourceId { /// Storage for loaded source files. pub struct SourceStore { - loader: Rc, + loader: Arc, files: HashMap, sources: Vec, } impl SourceStore { /// Create a new, empty source store. - pub fn new(loader: Rc) -> Self { + pub fn new(loader: Arc) -> Self { Self { loader, files: HashMap::new(), @@ -125,7 +125,7 @@ pub struct SourceFile { path: PathBuf, src: String, lines: Vec, - root: Rc, + root: Arc, } impl SourceFile { @@ -148,7 +148,7 @@ impl SourceFile { } /// The root node of the file's untyped green tree. - pub fn root(&self) -> &Rc { + pub fn root(&self) -> &Arc { &self.root } -- cgit v1.2.3