mirror of
https://github.com/typst/typst
synced 2025-05-17 02:25:27 +08:00
fix: revert comment changes
This commit is contained in:
parent
b64505fff8
commit
747a4a0f0d
@ -547,11 +547,10 @@ impl Content {
|
|||||||
|
|
||||||
#[scope]
|
#[scope]
|
||||||
impl Content {
|
impl Content {
|
||||||
/// The content's element function. This function can be used to create the
|
/// The content's element function. This function can be used to create the element
|
||||||
/// element contained in this content. It can be used in set and show
|
/// contained in this content. It can be used in set and show rules for the
|
||||||
/// rules for the element. Can be compared with global functions to
|
/// element. Can be compared with global functions to check whether you have
|
||||||
/// check whether you have a specific
|
/// a specific kind of element.
|
||||||
/// kind of element.
|
|
||||||
#[func]
|
#[func]
|
||||||
pub fn func(&self) -> Element {
|
pub fn func(&self) -> Element {
|
||||||
self.elem()
|
self.elem()
|
||||||
@ -882,8 +881,8 @@ impl<T: NativeElement> Deref for Packed<T> {
|
|||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
// Safety:
|
// Safety:
|
||||||
// - Packed<T> guarantees that the content trait object wraps an element of type
|
// - Packed<T> guarantees that the content trait object wraps
|
||||||
// `T`.
|
// an element of type `T`.
|
||||||
// - This downcast works the same way as dyn Any's does. We can't reuse that one
|
// - This downcast works the same way as dyn Any's does. We can't reuse that one
|
||||||
// because we don't want to pay the cost for every deref.
|
// because we don't want to pay the cost for every deref.
|
||||||
let elem = &*self.0.inner.elem;
|
let elem = &*self.0.inner.elem;
|
||||||
@ -897,8 +896,8 @@ impl<T: NativeElement> DerefMut for Packed<T> {
|
|||||||
// - Packed<T> guarantees that the content trait object wraps an element of type
|
// - Packed<T> guarantees that the content trait object wraps an element of type
|
||||||
// `T`.
|
// `T`.
|
||||||
// - We have guaranteed unique access thanks to `make_mut`.
|
// - We have guaranteed unique access thanks to `make_mut`.
|
||||||
// - This downcast works the same way as dyn Any's does. We can't reuse that one
|
// - This downcast works the same way as dyn Any's does. We can't reuse
|
||||||
// because we don't want to pay the cost for every deref.
|
// that one because we don't want to pay the cost for every deref.
|
||||||
let elem = &mut *self.0.make_mut().elem;
|
let elem = &mut *self.0.make_mut().elem;
|
||||||
unsafe { &mut *(elem as *mut dyn Bounds as *mut T) }
|
unsafe { &mut *(elem as *mut dyn Bounds as *mut T) }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user