mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make WeakRuleNode::from_ptr be unsafe
This commit is contained in:
parent
05accaa7bd
commit
e06e164571
1 changed files with 2 additions and 8 deletions
|
@ -369,7 +369,7 @@ impl StrongRuleNode {
|
|||
}
|
||||
|
||||
pub(super) fn downgrade(&self) -> WeakRuleNode {
|
||||
WeakRuleNode::from_ptr(self.p)
|
||||
unsafe { WeakRuleNode::from_ptr(self.p) }
|
||||
}
|
||||
|
||||
/// Get the parent rule node of this rule node.
|
||||
|
@ -750,12 +750,6 @@ impl Drop for StrongRuleNode {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a StrongRuleNode> for WeakRuleNode {
|
||||
fn from(node: &'a StrongRuleNode) -> Self {
|
||||
WeakRuleNode::from_ptr(node.p)
|
||||
}
|
||||
}
|
||||
|
||||
impl WeakRuleNode {
|
||||
#[inline]
|
||||
fn ptr(&self) -> *mut RuleNode {
|
||||
|
@ -770,7 +764,7 @@ impl WeakRuleNode {
|
|||
unsafe { StrongRuleNode::from_ptr(self.p) }
|
||||
}
|
||||
|
||||
fn from_ptr(p: ptr::NonNull<RuleNode>) -> Self {
|
||||
unsafe fn from_ptr(p: ptr::NonNull<RuleNode>) -> Self {
|
||||
WeakRuleNode { p }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue