From 7143969ef4403114ebf5c4f0b35ad9d7f6995f8e Mon Sep 17 00:00:00 2001 From: Ignacy Koper Date: Wed, 28 Aug 2024 22:27:36 +0200 Subject: [PATCH] convert all indents in `.rs` files from spaces to tabs --- src/decode/encodings/cond.rs | 2 +- src/decode/encodings/ident.rs | 19 ++++++++--------- src/decode/encodings/microcode.rs | 2 +- src/decode/encodings/mod.rs | 34 +++++++++++++++---------------- src/decode/mod.rs | 1 - src/main.rs | 9 ++++---- 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/decode/encodings/cond.rs b/src/decode/encodings/cond.rs index 3465a3c..c071980 100644 --- a/src/decode/encodings/cond.rs +++ b/src/decode/encodings/cond.rs @@ -42,7 +42,7 @@ pub struct EncodingCondition { name: String, #[serde(rename = "CondtionExpression")] - expression: ConditionExpression + expression: ConditionExpression, } #[derive(Debug, Default, PartialEq, Deserialize)] diff --git a/src/decode/encodings/ident.rs b/src/decode/encodings/ident.rs index aa2e765..4fcdc85 100644 --- a/src/decode/encodings/ident.rs +++ b/src/decode/encodings/ident.rs @@ -1,24 +1,23 @@ use serde::Deserialize; - #[derive(Debug, Default, PartialEq, Deserialize)] pub struct EncodingIdentifier { - #[serde(rename = "@Radix")] - radix: i8, - #[serde(rename = "$text")] - text: String, + #[serde(rename = "@Radix")] + radix: i8, + #[serde(rename = "$text")] + text: String, } #[derive(Debug, Default, PartialEq, Deserialize)] pub struct EncodingIdentifierMask { - #[serde(rename = "@Radix")] - radix: i8, - #[serde(rename = "$text")] - text: String, + #[serde(rename = "@Radix")] + radix: i8, + #[serde(rename = "$text")] + text: String, } #[derive(Debug, Default, PartialEq, Deserialize)] pub struct EncodingIdentifiers { #[serde(rename = "EncodingIdentifier")] - identifier: Vec + identifier: Vec, } diff --git a/src/decode/encodings/microcode.rs b/src/decode/encodings/microcode.rs index 039e37c..1620fbd 100644 --- a/src/decode/encodings/microcode.rs +++ b/src/decode/encodings/microcode.rs @@ -8,7 +8,7 @@ pub struct Range { #[serde(rename = "BitCount")] bit_count: i8, #[serde(rename = "BitOffset")] - bit_offset: i8 + bit_offset: i8, } #[derive(Debug, Default, PartialEq, Deserialize)] diff --git a/src/decode/encodings/mod.rs b/src/decode/encodings/mod.rs index 3461d94..46d718f 100644 --- a/src/decode/encodings/mod.rs +++ b/src/decode/encodings/mod.rs @@ -2,33 +2,33 @@ mod cond; mod ident; mod microcode; - use serde::Deserialize; + #[derive(Debug, Default, PartialEq, Deserialize)] pub struct Encoding { - #[serde(rename = "@Order")] - order: i8, + #[serde(rename = "@Order")] + order: i8, - #[serde(rename = "EncodingName")] - name: String, - #[serde(rename = "BitCount")] - bit_count: i8, - #[serde(rename = "EncodingIdentifierMask")] - identifier_mask: ident::EncodingIdentifierMask, - #[serde(rename = "EncodingIdentifiers")] - identifiers: Vec, - #[serde(rename = "EncodingConditions")] - conditions: Vec, + #[serde(rename = "EncodingName")] + name: String, + #[serde(rename = "BitCount")] + bit_count: i8, + #[serde(rename = "EncodingIdentifierMask")] + identifier_mask: ident::EncodingIdentifierMask, + #[serde(rename = "EncodingIdentifiers")] + identifiers: Vec, + #[serde(rename = "EncodingConditions")] + conditions: Vec, - #[serde(rename = "Description")] - description: String, + #[serde(rename = "Description")] + description: String, #[serde(rename = "MicrocodeFormat")] - microcode_format: microcode::MicrocodeFormat, + microcode_format: microcode::MicrocodeFormat, } #[derive(Debug, Default, PartialEq, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct Encodings { - encoding: Vec, + encoding: Vec, } diff --git a/src/decode/mod.rs b/src/decode/mod.rs index ee1045d..7919ea8 100644 --- a/src/decode/mod.rs +++ b/src/decode/mod.rs @@ -2,7 +2,6 @@ mod encodings; use serde::Deserialize; - #[derive(Debug, Default, PartialEq, Deserialize)] pub struct Spec { #[serde(rename = "Document")] diff --git a/src/main.rs b/src/main.rs index f3d04ee..cd7809e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,13 @@ mod decode; - fn main() -> Result<(), Box> { - let path: String = std::fs::read_to_string( - format!("{}/spec/amdgpu_isa_rdna3.xml", env!("CARGO_MANIFEST_DIR")) - )?; + let path: String = std::fs::read_to_string( + format!("{}/spec/amdgpu_isa_rdna3.xml", env!("CARGO_MANIFEST_DIR") + ))?; let spec: decode::Spec = quick_xml::de::from_str(path.as_str())?; println!("{:#?}", spec); - return Ok(()); + return Ok(()); }