Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <[email protected]>
  • Loading branch information
colifran committed Mar 26, 2024
1 parent d8e0ace commit fc1b23c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/synthesizer/csharp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ impl CsharpEmitter for ConditionIr {
ConditionIr::Ref(reference) => {
reference.emit_csharp(output);
Ok(())
},
}
ConditionIr::Str(str) => Ok(output.text(format!("\"{str}\""))),
ConditionIr::Condition(condition) => {
output.text(camel_case(condition));
Ok(())
},
}

ConditionIr::And(list) => {
for (index, condition) in list.iter().enumerate() {
Expand Down Expand Up @@ -485,15 +485,15 @@ impl ResourceIr {
ResourceIr::Bool(bool) => {
output.text(bool.to_string());
Ok(())
},
}
ResourceIr::Number(number) => {
output.text(number.to_string());
Ok(())
},
}
ResourceIr::Double(double) => {
output.text(double.to_string());
Ok(())
},
}
ResourceIr::String(str) => {
if str.lines().count() > 1 {
output.text(format!("@\"{str}\""));
Expand Down Expand Up @@ -627,7 +627,7 @@ impl ResourceIr {
ResourceIr::Ref(reference) => {
reference.emit_csharp(output);
Ok(())
},
}
ResourceIr::Sub(parts) => {
output.text("$\"");
for part in parts {
Expand Down
18 changes: 8 additions & 10 deletions src/synthesizer/java/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,11 @@ fn emit_java(
ResourceIr::Null => {
output.text("null");
Ok(())
},
}
ResourceIr::Bool(bool) => {
output.text(bool.to_string());
Ok(())
},
}
ResourceIr::Double(number) => Ok(output.text(format!("{number}"))),
ResourceIr::Number(number) => Ok(output.text(format!("{number}"))),
ResourceIr::String(text) => {
Expand Down Expand Up @@ -783,13 +783,11 @@ fn emit_java(
}
Ok(())
}
other => {
Err(Error::TypeReferenceError {
message: format!(
"Type reference {other:#?} not implemented for ResourceIr::Object"
),
})
}
other => Err(Error::TypeReferenceError {
message: format!(
"Type reference {other:#?} not implemented for ResourceIr::Object"
),
}),
},

// Intrinsics
Expand Down Expand Up @@ -913,7 +911,7 @@ fn emit_java(
ResourceIr::Ref(reference) => {
output.text(emit_reference(reference));
Ok(())
},
}
}
}

Expand Down

0 comments on commit fc1b23c

Please sign in to comment.