mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
tests_build: clippy let_and_return
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d5acaa8946
commit
049c2baebd
@@ -324,17 +324,15 @@ fn image_doc(s: &mut Session) -> NodeId {
|
||||
fn add_image(s: &mut Session, r: &drawcraft_trace::Raster, xf: Affine) -> NodeId {
|
||||
let png = r.encode_png();
|
||||
let (w, h) = (r.width, r.height);
|
||||
let id = s
|
||||
.edit("img", |d, sel| {
|
||||
d.images.insert("img1".into(), ImageBlob { mime: "image/png".into(), bytes: Arc::new(png) });
|
||||
let id = d.alloc_id();
|
||||
let l = d.default_layer();
|
||||
d.insert(l, 0, Node::new(id, NodeKind::Image(ImageObject { key: "img1".into(), width: w, height: h, xf, link: None })))?;
|
||||
sel.set([id]);
|
||||
Ok(id)
|
||||
})
|
||||
.unwrap();
|
||||
id
|
||||
s.edit("img", |d, sel| {
|
||||
d.images.insert("img1".into(), ImageBlob { mime: "image/png".into(), bytes: Arc::new(png) });
|
||||
let id = d.alloc_id();
|
||||
let l = d.default_layer();
|
||||
d.insert(l, 0, Node::new(id, NodeKind::Image(ImageObject { key: "img1".into(), width: w, height: h, xf, link: None })))?;
|
||||
sel.set([id]);
|
||||
Ok(id)
|
||||
})
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn traced_paths(n: &Node) -> Vec<Arc<Node>> {
|
||||
|
||||
Reference in New Issue
Block a user