Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat some docs to work around clippy::doc_overindented_list_items #811

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions vello_encoding/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ pub struct Style {
/// Encodes the stroke and fill style parameters. This field is split into two 16-bit
/// parts:
///
/// - `flags: u16` - encodes fill vs stroke, even-odd vs non-zero fill mode for fills and cap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong feelings about this one, although I'm not sure that the new formatting is better. I can see reasonable arguments for making it an HTML table, or just expecting the lint here.

/// and join style for strokes. See the FLAGS_* constants below for more
/// information.
/// ```text
/// flags: |style|fill|join|start cap|end cap|reserved|
/// bits: 0 1 2-3 4-5 6-7 8-15
/// ```
/// - `flags: u16` - encodes fill vs stroke, even-odd vs non-zero fill
/// mode for fills and cap and join style for strokes. See the
/// `FLAGS_*` constants below for more information.
///
/// - `miter_limit: u16` - The miter limit for a stroke, encoded in binary16 (half) floating
/// point representation. This field is only meaningful for the
/// `Join::Miter` join style. It's ignored for other stroke styles and
/// fills.
/// ```text
/// flags: |style|fill|join|start cap|end cap|reserved|
/// bits: 0 1 2-3 4-5 6-7 8-15
/// ```
///
/// - `miter_limit: u16` - The miter limit for a stroke, encoded in
/// binary16 (half) floating point representation. This field is
/// only meaningful for the `Join::Miter` join style. It's ignored
/// for other stroke styles and fills.
pub flags_and_miter_limit: u32,

/// Encodes the stroke width. This field is ignored for fills.
Expand Down Expand Up @@ -460,18 +461,18 @@ impl<'a> PathEncoder<'a> {
/// The algorithm is as follows:
///
/// a) If a GPU thread is processing a regular segment (i.e. `SUBPATH_END_BIT` is 0), it
/// outputs the offset curves for the segment. If the segment is immediately followed by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that making this a proper nested sublist is probably better style, i.e. replace a) with either 1. or -.

Certainly the existing indentation strongly suggests it's intended to be a nested sublist

/// the marker segment, then the same thread draws an end cap if the subpath is open
/// (i.e. the marker is a quad-to) or a join if the subpath is closed (i.e. the marker is
/// a line-to) using the tangent encoded in the marker segment.
/// outputs the offset curves for the segment. If the segment is immediately followed by
/// the marker segment, then the same thread draws an end cap if the subpath is open
/// (i.e. the marker is a quad-to) or a join if the subpath is closed (i.e. the marker is
/// a line-to) using the tangent encoded in the marker segment.
///
/// If the segment is immediately followed by another regular segment, then the thread
/// draws a join using the start tangent of the neighboring segment.
/// If the segment is immediately followed by another regular segment, then the thread
/// draws a join using the start tangent of the neighboring segment.
///
/// b) If a GPU thread is processing the marker segment (i.e. `SUBPATH_END_BIT` is 1), then
/// it draws a start cap using the information encoded in the segment IF the subpath is
/// open (i.e. the marker is a quad-to). If the subpath is closed (i.e. the marker is a
/// line-to), the thread draws nothing.
/// it draws a start cap using the information encoded in the segment IF the subpath is
/// open (i.e. the marker is a quad-to). If the subpath is closed (i.e. the marker is a
/// line-to), the thread draws nothing.
pub fn new(
tags: &'a mut Vec<PathTag>,
data: &'a mut Vec<u8>,
Expand Down