refactor: migrate project from C++ to Rust
- establish basic Rust project layout. - move all old code into independent directory.
This commit is contained in:
11
wfassoc_dylib/Cargo.toml
Normal file
11
wfassoc_dylib/Cargo.toml
Normal 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
14
wfassoc_dylib/src/lib.rs
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user