Cotton code
19 lines · 1.7 KB · RustRaw
use cotton_core::definitions::{package::ToolPackage, TableDefinition};pub fn package() -> ToolPackage {    let tool = serde_json::from_str(include_str!("../fixtures/work/manifest.json")).unwrap();    let tables: Vec<TableDefinition> = [        include_str!("../fixtures/work/tables/effort.json"),        include_str!("../fixtures/work/tables/lane.json"),        include_str!("../fixtures/work/tables/cut.json"),        include_str!("../fixtures/work/tables/landing.json"),    ].into_iter().map(|table| serde_json::from_str(table).unwrap()).collect();    let pictures = [        ("1eed78487ae29f98d958b9b9a88f993ddfd53c5201d49e02d5498fe4e620cdef.png", include_bytes!("../fixtures/work/pictures/1eed78487ae29f98d958b9b9a88f993ddfd53c5201d49e02d5498fe4e620cdef.png").as_slice()),        ("3f689d32d5fcacc37fe5aa246e094632095a9baa011938787d1bec2c81a99282.png", include_bytes!("../fixtures/work/pictures/3f689d32d5fcacc37fe5aa246e094632095a9baa011938787d1bec2c81a99282.png").as_slice()),        ("ad9782109efc1cc0c7423b6669cae1bc1f461591c991f5c8d20f13041358f9c2.png", include_bytes!("../fixtures/work/pictures/ad9782109efc1cc0c7423b6669cae1bc1f461591c991f5c8d20f13041358f9c2.png").as_slice()),        ("c6e7cbc4fa8c86874d5b43fe469b6cc47d82775ca5be4aa116e941128e2ef80d.png", include_bytes!("../fixtures/work/pictures/c6e7cbc4fa8c86874d5b43fe469b6cc47d82775ca5be4aa116e941128e2ef80d.png").as_slice()),        ("c9d03b54e2ad188b023ba603aa1335e1a880a8acc22d7e593114d7c05354dfa7.png", include_bytes!("../fixtures/work/pictures/c9d03b54e2ad188b023ba603aa1335e1a880a8acc22d7e593114d7c05354dfa7.png").as_slice()),    ].into_iter().map(|(name, bytes)| (name.to_string(), bytes.to_vec())).collect();    ToolPackage { board: None, tool, tables, pictures, samples: Default::default() }}