Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Jul 14, 2024
1 parent d7bb583 commit 03b8ea3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ pub struct TestHarness {
}

impl TestHarness {
pub fn new(test_rules: Vec<ExpectFile>, tests: SortedMap<TestId, Arc<Test>>, cfg: &Config) -> Self {
pub fn new(
test_rules: Vec<ExpectFile>,
tests: SortedMap<TestId, Arc<Test>>,
cfg: &Config,
) -> Self {
let toolchains = toolchains::create_toolchains(cfg);
Self {
paths: cfg.paths.clone(),
Expand Down
19 changes: 10 additions & 9 deletions src/harness/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,12 @@ impl std::fmt::Display for TestKeyPattern {
caller,
callee,
toolchain,
options: TestOptionsPattern {
convention,
val_generator,
repr,
},
options:
TestOptionsPattern {
convention,
val_generator,
repr,
},
} = self;
let separator = "::";
let mut output = String::new();
Expand Down Expand Up @@ -417,22 +418,22 @@ impl std::fmt::Display for TestKeyPattern {
impl<'de> Deserialize<'de> for TestKeyPattern {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>
D: serde::Deserializer<'de>,
{
use serde::de::Error;
let input = String::deserialize(deserializer)?;
input.parse().map_err(|e| D::Error::custom(e))
input.parse().map_err(D::Error::custom)
}
}
impl Serialize for TestKeyPattern {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer {
S: serde::Serializer,
{
self.to_string().serialize(serializer)
}
}


#[derive(Debug, Clone, Serialize)]
pub struct TestRules {
pub run: TestRunMode,
Expand Down
4 changes: 3 additions & 1 deletion src/harness/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ impl TestWithToolchain {
}
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, serde::Deserialize, serde::Serialize)]
#[derive(
Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, serde::Deserialize, serde::Serialize,
)]
#[serde(rename = "lowercase")]
pub enum CallingConvention {
/// The platform's default C convention (cdecl?)
Expand Down

0 comments on commit 03b8ea3

Please sign in to comment.