summaryrefslogtreecommitdiff
path: root/src/frame.rs
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/frame.rs
parentfa57d86ed981373b66804972147bf59cab920e6b (diff)
Switch from `Rc` to `Arc`
Diffstat (limited to 'src/frame.rs')
-rw-r--r--src/frame.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/frame.rs b/src/frame.rs
index 133ba256..f714fbbe 100644
--- a/src/frame.rs
+++ b/src/frame.rs
@@ -1,7 +1,7 @@
//! Finished layouts.
use std::fmt::{self, Debug, Formatter};
-use std::rc::Rc;
+use std::sync::Arc;
use crate::font::FaceId;
use crate::geom::{Align, Em, Length, Paint, Path, Point, Size, Spec, Transform};
@@ -43,7 +43,7 @@ impl Frame {
}
/// Add a group element.
- pub fn push_frame(&mut self, pos: Point, frame: Rc<Self>) {
+ pub fn push_frame(&mut self, pos: Point, frame: Arc<Self>) {
self.elements.push((pos, Element::Group(Group::new(frame))));
}
@@ -100,7 +100,7 @@ impl Frame {
F: FnOnce(&mut Group),
{
let mut wrapper = Frame { elements: vec![], ..*self };
- let mut group = Group::new(Rc::new(std::mem::take(self)));
+ let mut group = Group::new(Arc::new(std::mem::take(self)));
f(&mut group);
wrapper.push(Point::zero(), Element::Group(group));
*self = wrapper;
@@ -149,7 +149,7 @@ pub enum Element {
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Group {
/// The group's frame.
- pub frame: Rc<Frame>,
+ pub frame: Arc<Frame>,
/// A transformation to apply to the group.
pub transform: Transform,
/// Whether the frame should be a clipping boundary.
@@ -158,7 +158,7 @@ pub struct Group {
impl Group {
/// Create a new group with default settings.
- pub fn new(frame: Rc<Frame>) -> Self {
+ pub fn new(frame: Arc<Frame>) -> Self {
Self {
frame,
transform: Transform::identity(),