Skip to content

Commit

Permalink
convert all indents in .rs files from spaces to tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyrain266 committed Aug 28, 2024
1 parent 15b5bd2 commit 7143969
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/decode/encodings/cond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct EncodingCondition {
name: String,

#[serde(rename = "CondtionExpression")]
expression: ConditionExpression
expression: ConditionExpression,
}

#[derive(Debug, Default, PartialEq, Deserialize)]
Expand Down
19 changes: 9 additions & 10 deletions src/decode/encodings/ident.rs
Original file line number Diff line number Diff line change
@@ -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<EncodingIdentifier>
identifier: Vec<EncodingIdentifier>,
}
2 changes: 1 addition & 1 deletion src/decode/encodings/microcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
34 changes: 17 additions & 17 deletions src/decode/encodings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ident::EncodingIdentifiers>,
#[serde(rename = "EncodingConditions")]
conditions: Vec<cond::EncodingConditions>,
#[serde(rename = "EncodingName")]
name: String,
#[serde(rename = "BitCount")]
bit_count: i8,
#[serde(rename = "EncodingIdentifierMask")]
identifier_mask: ident::EncodingIdentifierMask,
#[serde(rename = "EncodingIdentifiers")]
identifiers: Vec<ident::EncodingIdentifiers>,
#[serde(rename = "EncodingConditions")]
conditions: Vec<cond::EncodingConditions>,

#[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>,
encoding: Vec<Encoding>,
}
1 change: 0 additions & 1 deletion src/decode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ mod encodings;

use serde::Deserialize;


#[derive(Debug, Default, PartialEq, Deserialize)]
pub struct Spec {
#[serde(rename = "Document")]
Expand Down
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
mod decode;


fn main() -> Result<(), Box<dyn std::error::Error>> {
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(());
}

0 comments on commit 7143969

Please sign in to comment.