Skip to content

Commit 281eefd

Browse files
committed
fmt: cargo
1 parent 6767986 commit 281eefd

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

float-pigment-forest/src/layout/layout_impl.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use float_pigment_css::{
88
},
99
};
1010
use float_pigment_layout::{
11-
DefLength, Edge, EdgeOption, InlineMeasure, InlineUnit, InlineUnitMetadata, LayoutNode, LayoutStyle, LayoutTreeNode, LayoutTreeVisitor, MeasureResult, OptionNum, OptionSize, Point, Size, Vector
11+
DefLength, EdgeOption, InlineMeasure, InlineUnit, InlineUnitMetadata, LayoutNode, LayoutStyle,
12+
LayoutTreeNode, LayoutTreeVisitor, MeasureResult, OptionNum, OptionSize, Point, Size, Vector,
1213
};
1314

1415
use crate::{convert_node_ref_to_ptr, Length};
@@ -396,9 +397,7 @@ impl InlineMeasure<Node> for LayoutInlineMeasure {
396397
inline_nodes
397398
.into_iter()
398399
.for_each(|InlineUnitMetadata { unit, margin }| {
399-
if (current_line.total_inline_size
400-
+ unit.size.width
401-
+ margin.horizontal()
400+
if (current_line.total_inline_size + unit.size.width + margin.horizontal()
402401
> suggested_width)
403402
&& !current_line.is_empty()
404403
{

float-pigment-layout/src/algo/flow.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,10 @@ impl<T: LayoutTreeNode> Flow<T> for LayoutUnit<T> {
578578
},
579579
)
580580
};
581-
InlineUnitMetadata { unit, margin: child_margin }
581+
InlineUnitMetadata {
582+
unit,
583+
margin: child_margin,
584+
}
582585
})
583586
.collect();
584587
let (block_size, positions) = T::InlineMeasure::block_size(

float-pigment-layout/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,7 @@ pub trait InlineUnit<T: LayoutTreeNode> {
404404
type Env;
405405

406406
/// Construct from a tree node with specified size and baseline information.
407-
fn new(
408-
env: &mut Self::Env,
409-
node: &T,
410-
result: MeasureResult<T::Length>,
411-
) -> Self;
407+
fn new(env: &mut Self::Env, node: &T, result: MeasureResult<T::Length>) -> Self;
412408
}
413409

414410
/// The result of the measure function.

float-pigment-layout/src/unit.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,11 @@ impl<T: LayoutTreeNode> LayoutUnit<T> {
649649
let ret = T::InlineUnit::new(
650650
env,
651651
node,
652-
MeasureResult { size, first_baseline_ascent, last_baseline_ascent },
652+
MeasureResult {
653+
size,
654+
first_baseline_ascent,
655+
last_baseline_ascent,
656+
},
653657
);
654658
Some(ret)
655659
} else {

0 commit comments

Comments
 (0)