reddit 上有不少人对 Rust 的工程如何进行组织, 以及如何才能进行更加完善的测试进行了一些讨论.web 服务的例子, 演示了如何来组织 Rust 中的模块, 以及如何让代码更加具有测试性.ANTLER是一个无纹理的渲染引擎.{
tree: { Here: { // Adaptive-tree settings specified here:
tar_tris: 5, // Target num triangles per leaf cell.
max_depth: 8, // (ignore) Maximum tree splitting depth.
padding: 0.01, // (ignore) Fraction to increase leaf cells.
}},
sett : { There: 'sett/standard.json5' }, // Use the sim settings from this file.
shader : { There: 'shaders/nice.json5' }, // Use the shader from this file.
surfs : { There: 'scenes/path.json5' }, // Thus surfaces in this file.
attrs : { There: 'attrs/path.json5' }, // Use the attributes from this file.
cols : { There: 'cols/path.json5' }, // Use the colours from this file.
cam : { Here: { // Camera settings specified here:
pos : [-52, 0, 7], // Camera observation position.
tar : [-4.5, 0, 1.2], // Camera target postion.
lens : { Perspective: {fov: 60.0} }, // Lens type and parameters.
aspect : "Square", // Aspect ratio type.
// ss_power: 3, // Optional super sampling. NxN per pixel.
hr_res : 400, // Number of horizontal pixels.
}},
update_size: 400, // Pixels per window refresh.
}


<<使用 Rust 创造一门新语言>>的最新一章, 函数调用.email-parser 是一个无任何依赖,目前解析最快的一个 email 解析库.原文作者:Rust语言中文社区;如有侵权,请联系管理员删除。