Skip to content

Commit

Permalink
format the Rust code
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Jul 26, 2024
1 parent be953c1 commit 5e8a2e3
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 177 deletions.
5 changes: 4 additions & 1 deletion crates/cpp/tests/meshless_strings/rust_comp_a/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use std::env;

fn main() {
let source_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
println!("cargo::rustc-link-search=native={}/../component_b", source_dir);
println!(
"cargo::rustc-link-search=native={}/../component_b",
source_dir
);
println!("cargo::rustc-link-lib=static=component_b");
println!("cargo::rustc-link-lib=static=stdc++");
}
6 changes: 3 additions & 3 deletions crates/cpp/tests/meshless_strings/rust_comp_a/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use the_world::foo::foo::strings;
use the_world::exports::foo::foo::strings::Guest;
use the_world::foo::foo::strings;

mod the_world;

struct MyWorld;

impl Guest for MyWorld {
fn a(x: String,) {
fn a(x: String) {
println!("{x}");
}

fn b() -> String {
String::from("hello B")
}

fn c(a: String,b: String,) -> String {
fn c(a: String, b: String) -> String {
println!("{a}|{b}");
"hello C".into()
}
Expand Down
Loading

0 comments on commit 5e8a2e3

Please sign in to comment.