formatting: Using canonical formatting on whole project
This commit is contained in:
@@ -8,8 +8,7 @@ use vxls_attributes::LayoutError;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Default, Pod, Zeroable, Attributes, Debug)]
|
||||
#[repr(C)]
|
||||
struct TestAttributes
|
||||
{
|
||||
struct TestAttributes {
|
||||
#[attribute(label = "color", semantic = "color")]
|
||||
color: u32,
|
||||
|
||||
@@ -20,8 +19,7 @@ struct TestAttributes
|
||||
reserved: u32,
|
||||
}
|
||||
|
||||
fn sample(color: u32, normal: [f32; 3]) -> TestAttributes
|
||||
{
|
||||
fn sample(color: u32, normal: [f32; 3]) -> TestAttributes {
|
||||
TestAttributes {
|
||||
color,
|
||||
normal,
|
||||
@@ -30,8 +28,7 @@ fn sample(color: u32, normal: [f32; 3]) -> TestAttributes
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn layout_matches_the_declared_fields()
|
||||
{
|
||||
fn layout_matches_the_declared_fields() {
|
||||
let layout = TestAttributes::LAYOUT;
|
||||
|
||||
assert_eq!(layout.len(), 2);
|
||||
@@ -54,8 +51,7 @@ fn layout_matches_the_declared_fields()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_attr_returns_the_field_bytes()
|
||||
{
|
||||
fn get_attr_returns_the_field_bytes() {
|
||||
let value = sample(0x1122_3344, [1.0, 2.0, 3.0]);
|
||||
|
||||
assert_eq!(value.get_attr(0), bytemuck::bytes_of(&value.color));
|
||||
@@ -63,14 +59,15 @@ fn get_attr_returns_the_field_bytes()
|
||||
assert!(value.try_get_attr(2).is_none());
|
||||
|
||||
let mut value = value;
|
||||
value.get_attr_mut(0).copy_from_slice(&0xAABB_CCDDu32.to_ne_bytes());
|
||||
value
|
||||
.get_attr_mut(0)
|
||||
.copy_from_slice(&0xAABB_CCDDu32.to_ne_bytes());
|
||||
assert_eq!(value.color, 0xAABB_CCDD);
|
||||
assert!(value.try_get_attr_mut(2).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn average_is_component_wise_and_skips_the_reserved_field()
|
||||
{
|
||||
fn average_is_component_wise_and_skips_the_reserved_field() {
|
||||
let first = TestAttributes {
|
||||
color: 2,
|
||||
normal: [1.0, 2.0, 3.0],
|
||||
@@ -92,8 +89,7 @@ fn average_is_component_wise_and_skips_the_reserved_field()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn validate_rejects_duplicate_labels_and_semantics()
|
||||
{
|
||||
fn validate_rejects_duplicate_labels_and_semantics() {
|
||||
const DUPLICATE_LABELS: AttributesLayout = AttributesLayout {
|
||||
attributes: &[
|
||||
AttributeDescriptor {
|
||||
|
||||
Reference in New Issue
Block a user