cargo init --lib

Signed-off-by: Jia Chao <jiac13@chinaunicom.cn>
This commit is contained in:
Jia Chao 2024-04-29 10:20:10 +08:00
parent dd7caa1300
commit 9eb62ef67c
3 changed files with 32 additions and 0 deletions

5
.gitignore vendored
View File

@ -14,3 +14,8 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
# Added by cargo
/target

13
Cargo.toml Normal file
View File

@ -0,0 +1,13 @@
[package]
name = "cve-xmlparser"
version = "0.1.0"
edition = "2021"
authors = ["Jia Chao <jiachao2130@126.com"]
license = "MIT"
keywords = ["cve", "xml"]
include = ["src/**/*", "Cargo.toml", "README.md"]
description = "An xml parser for cve."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[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);
}
}