cargo init --lib

Signed-off-by: Jia Chao <jiac13@chinaunicom.cn>
This commit is contained in:
Jia Chao 2024-06-13 15:20:41 +08:00
parent 3defac6916
commit 81e3c048ff
3 changed files with 32 additions and 0 deletions

12
.gitignore vendored
View File

@ -14,3 +14,15 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information # MSVC Windows builds of rustc generate these, which store debugging information
*.pdb *.pdb
# Added by cargo
/target
# Added by cargo
#
# already existing elements were commented out
#/target

6
Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "updateinfo-xmlparser"
version = "0.1.0"
edition = "2021"
[dependencies]

14
src/lib.rs Normal file
View File

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