Integration: cargo fmt

This commit is contained in:
aiongg
2026-10-16 04:21:41 +00:00
parent 4ebcd78a03
commit 7979a417fe
2 changed files with 12 additions and 6 deletions
+1 -5
View File
@@ -276,11 +276,7 @@ pub(crate) fn point_param(p: &Value, key: &str) -> Option<Point> {
/// `r`, computed from coordinate params, or an error when a value overflowed to infinity or NaN:
/// a document holding one can't be saved (#1050).
pub(crate) fn finite_rect(command: &str, r: Rect) -> Result<Rect> {
if [r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) {
Ok(r)
} else {
Err(bad(command, "the position and size must stay finite numbers"))
}
if [r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) { Ok(r) } else { Err(bad(command, "the position and size must stay finite numbers")) }
}
pub(crate) fn rect_param(p: &Value, key: &str) -> Option<Rect> {
+11 -1
View File
@@ -34,7 +34,17 @@ fn shown(file: Vec<u8>, fill: Fill) -> Vec<[u8; 4]> {
let aid = AssetId(d.alloc());
d.assets.insert(
aid,
Arc::new(Asset { page: 0, id: aid, name: "a".into(), mime: "image/png".into(), link: None, data: Arc::new(file), pixels: Some((3, 1)), pdf_crop: Default::default(), pdf_box: None }),
Arc::new(Asset {
page: 0,
id: aid,
name: "a".into(),
mime: "image/png".into(),
link: None,
data: Arc::new(file),
pixels: Some((3, 1)),
pdf_crop: Default::default(),
pdf_box: None,
}),
);
let id = ItemId(d.alloc());
let mut it = Item::new(id, d.default_layer(), Shape::Rectangle, shapes::rectangle(Rect::new(100.0, 100.0, 250.0, 150.0)));