Skip to content

Commit

Permalink
fix: use load_full in arc_swap
Browse files Browse the repository at this point in the history
  • Loading branch information
zimond committed Dec 6, 2024
1 parent 10ea022 commit a0d3485
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fontkit-rs",
"version": "0.0.14",
"version": "0.0.15-beta.2",
"description": "Toolkit used to load, match, measure, and render texts",
"main": "index.js",
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ impl Font {

pub fn face(&self, key: &FontKey) -> Result<StaticFace, Error> {
self.load()?;
let buffer = self.buffer.load().clone();
let buffer = self.buffer.load().to_vec();
let filters = Filter::from_key(key);
let mut queue = self.variants.iter().collect::<Vec<_>>();
for filter in filters {
Expand Down Expand Up @@ -558,7 +558,7 @@ impl Font {
pub struct StaticFace {
key: FontKey,
pub(crate) path: PathBuf,
pub(crate) buffer: Arc<Vec<u8>>,
pub(crate) buffer: Vec<u8>,
#[borrows(buffer)]
#[covariant]
pub(crate) face: Face<'this>,
Expand Down
2 changes: 1 addition & 1 deletion src/wit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl fi::GuestFont for StaticFace {
}

fn buffer(&self) -> Vec<u8> {
self.borrow_buffer().as_ref().clone()
self.borrow_buffer().clone()
}

fn path(&self) -> String {
Expand Down

0 comments on commit a0d3485

Please sign in to comment.