Skip to content

Commit

Permalink
docs: adds missing documentation (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin authored Oct 2, 2024
1 parent 99990c3 commit a35bd13
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/conversion/typst2vec/src/incr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub struct IncrDocServer {
}

impl IncrDocServer {
/// Set whether to attach debug info to the spans.
pub fn set_should_attach_debug_info(&mut self, should_attach_debug_info: bool) {
self.typst2vec
.spans
Expand Down
1 change: 1 addition & 0 deletions crates/conversion/typst2vec/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use typst::text::Font;
/// A glyph item.
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub enum GlyphItem {
/// A missing glyph.
None,

/// Raw glyph representation.
Expand Down
8 changes: 4 additions & 4 deletions crates/conversion/typst2vec/src/path2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ impl SvgPath2DBuilder {

impl ttf_parser::OutlineBuilder for SvgPath2DBuilder {
fn move_to(&mut self, x: f32, y: f32) {
write!(&mut self.0, "M {} {} ", x, y).unwrap();
write!(&mut self.0, "M {x} {y} ").unwrap();
}

fn line_to(&mut self, x: f32, y: f32) {
write!(&mut self.0, "L {} {} ", x, y).unwrap();
write!(&mut self.0, "L {x} {y} ").unwrap();
}

fn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32) {
write!(&mut self.0, "Q {} {} {} {} ", x1, y1, x, y).unwrap();
write!(&mut self.0, "Q {x1} {y1} {x} {y} ").unwrap();
}

fn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32) {
write!(&mut self.0, "C {} {} {} {} {} {} ", x1, y1, x2, y2, x, y).unwrap();
write!(&mut self.0, "C {x1} {y1} {x2} {y2} {x} {y} ").unwrap();
}

fn close(&mut self) {
Expand Down
1 change: 1 addition & 0 deletions crates/conversion/typst2vec/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl AbsExt for Abs {

/// Additional methods for types that can be converted to CSS.
pub trait ToCssExt {
/// Convert to a CSS string.
fn to_css(self) -> String;
}

Expand Down

0 comments on commit a35bd13

Please sign in to comment.