1
0

refactor: migrate project from C++ to Rust

- establish basic Rust project layout.
- move all old code into independent directory.
This commit is contained in:
2025-10-04 22:04:30 +08:00
parent d6c4c7687b
commit e06fcdf53b
26 changed files with 593 additions and 407 deletions

11
wfassoc_dylib/Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "wfassoc_dylib"
version = "0.1.0"
authors = ["yyc12345"]
edition = "2024"
description = "The dynamic wfassoc library exposed for C/C++ and other languages users."
license = "SPDX:MIT"
[dependencies]
thiserror = { workspace = true }
wfassoc = { path="../wfassoc" }

14
wfassoc_dylib/src/lib.rs Normal file
View File

@ -0,0 +1,14 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}