summaryrefslogtreecommitdiff
path: root/src/loading
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-31 16:06:44 +0100
committerLaurenz <laurmaedje@gmail.com>2022-01-31 16:47:00 +0100
commit20b1a38414101f842a6d9201133a5aaaa45a7cec (patch)
tree2365453d4dfdebfa11d618baad1a36c65b62d7c7 /src/loading
parentfa57d86ed981373b66804972147bf59cab920e6b (diff)
Switch from `Rc` to `Arc`
Diffstat (limited to 'src/loading')
-rw-r--r--src/loading/fs.rs8
-rw-r--r--src/loading/mem.rs8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/loading/fs.rs b/src/loading/fs.rs
index 4c46c80c..3f4a45e1 100644
--- a/src/loading/fs.rs
+++ b/src/loading/fs.rs
@@ -1,7 +1,7 @@
use std::fs::{self, File};
use std::io;
use std::path::Path;
-use std::rc::Rc;
+use std::sync::Arc;
use memmap2::Mmap;
use same_file::Handle;
@@ -35,10 +35,10 @@ impl FsLoader {
self
}
- /// Builder-style method to wrap the loader in an [`Rc`] to make it usable
+ /// Builder-style method to wrap the loader in an [`Arc`] to make it usable
/// with the [`Context`](crate::Context).
- pub fn wrap(self) -> Rc<Self> {
- Rc::new(self)
+ pub fn wrap(self) -> Arc<Self> {
+ Arc::new(self)
}
/// Search for fonts in the operating system's font directories.
diff --git a/src/loading/mem.rs b/src/loading/mem.rs
index 9ff02d2d..5e3e78d1 100644
--- a/src/loading/mem.rs
+++ b/src/loading/mem.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
use std::collections::HashMap;
use std::io;
use std::path::{Path, PathBuf};
-use std::rc::Rc;
+use std::sync::Arc;
use super::{FileHash, Loader};
use crate::font::FaceInfo;
@@ -31,10 +31,10 @@ impl MemLoader {
self
}
- /// Builder-style method to wrap the loader in an [`Rc`] to make it usable
+ /// Builder-style method to wrap the loader in an [`Arc`] to make it usable
/// with the [`Context`](crate::Context).
- pub fn wrap(self) -> Rc<Self> {
- Rc::new(self)
+ pub fn wrap(self) -> Arc<Self> {
+ Arc::new(self)
}
/// Insert a path-file mapping. If the data forms a font, then that font