mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Correct docs that misstate what the code does
This commit is contained in:
@@ -38,7 +38,6 @@ impl<'r> Rec<'r> {
|
||||
|
||||
/// An opaque record value: every non-empty record spills to a claimed frame
|
||||
/// and the value carries its pointer, while an empty record carries nothing.
|
||||
/// Only [`Layout::rec`] reads it, against the wiring-proven layout.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct RecordValue<'e> {
|
||||
pub(in crate::record) ptr: *const u8,
|
||||
|
||||
@@ -370,7 +370,7 @@ mod tests {
|
||||
let bounds = (base as usize, buffer.len() * 8);
|
||||
let length = "shared across lanes".len();
|
||||
unsafe { write_element_sized(base, String::from("shared across lanes"), &transient, length) }.unwrap();
|
||||
// A carried field byte-copies the reference, so both lanes name the one park.
|
||||
// A carried element byte-copies its park reference, so both lanes name the one park.
|
||||
let shared = unsafe { base.cast::<*const u8>().read() };
|
||||
unsafe { base.add(stride).cast::<*const u8>().write(shared) };
|
||||
|
||||
|
||||
@@ -314,8 +314,8 @@ impl<'e> GroupItem<'e> {
|
||||
}
|
||||
|
||||
/// Re-parks an owned item's lanes into `arena`, restoring the resident
|
||||
/// form; `None` reports arena exhaustion. A resident item returns a plain
|
||||
/// clone.
|
||||
/// form; `None` reports arena exhaustion. A resident item re-adopts into
|
||||
/// `arena`, sharing only where its lanes already live there.
|
||||
pub fn replay<'a>(&self, arena: &'a crate::arena::Arena) -> Option<GroupItem<'a>> {
|
||||
let ItemStorage::Owned(owned) = &self.storage else {
|
||||
// A resident item re-serves at the target arena's own lifetime,
|
||||
@@ -584,7 +584,7 @@ impl graphene_hash::CacheHash for GroupItem<'_> {
|
||||
let stride = self.layout.lane_stride();
|
||||
let frames = self.frames();
|
||||
for lane in 0..self.len {
|
||||
// SAFETY: `adopt` filled `len` lanes of `layout`.
|
||||
// SAFETY: the constructors store `len` lanes of `layout` at the layout's stride.
|
||||
unsafe { record_content_hash(&self.layout, frames.add(lane * stride), state) };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ pub struct NodeMetadata {
|
||||
pub context_features: Vec<ContextFeature>,
|
||||
pub memoize: bool,
|
||||
pub inject_scope: bool,
|
||||
/// The macro appended its hidden `_runtime` and `_source` fields as the last two entries of `fields`.
|
||||
/// Set where `_runtime` and `_source` are the last two entries of `fields`.
|
||||
pub async_source_fields: bool,
|
||||
}
|
||||
|
||||
@@ -389,8 +389,8 @@ mod tests {
|
||||
assert_eq!(held.len(), 4);
|
||||
}
|
||||
|
||||
/// Evaluates its content at three promoted index levels and serves the
|
||||
/// collected elements.
|
||||
/// Evaluates its content at three indices of one promoted level and serves
|
||||
/// the collected elements.
|
||||
struct RepeatNode<Node0, T> {
|
||||
content: Node0,
|
||||
inner: Layout,
|
||||
|
||||
@@ -91,7 +91,7 @@ pub fn group_to_legacy_graphic(group: &core_types::record::Group) -> Graphic<'st
|
||||
}
|
||||
|
||||
/// The group as a legacy `List<Graphic>`: a `Graphic` run becomes the items,
|
||||
/// another typed run becomes one item holding its typed list.
|
||||
/// another typed run becomes one de-tabled leaf item per lane.
|
||||
pub fn group_to_legacy_list(group: &core_types::record::Group) -> List<Graphic<'static>> {
|
||||
let item = &group.content;
|
||||
if let Some(mut list) = run_to_legacy_list::<Graphic>(item) {
|
||||
|
||||
Reference in New Issue
Block a user