chore: initialize a new workspace with empty lib project
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
01.workspace/target
|
||||||
7
01.workspace/Cargo.lock
generated
Normal file
7
01.workspace/Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "oxidice_lib"
|
||||||
|
version = "0.1.0"
|
||||||
5
01.workspace/Cargo.toml
Normal file
5
01.workspace/Cargo.toml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[workspace]
|
||||||
|
|
||||||
|
resolver = "3"
|
||||||
|
|
||||||
|
members = ["oxidice_lib"]
|
||||||
6
01.workspace/oxidice_lib/Cargo.toml
Normal file
6
01.workspace/oxidice_lib/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "oxidice_lib"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
14
01.workspace/oxidice_lib/src/lib.rs
Normal file
14
01.workspace/oxidice_lib/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