cargo init --lib
Signed-off-by: Jia Chao <jiac13@chinaunicom.cn>
This commit is contained in:
parent
dd7caa1300
commit
9eb62ef67c
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -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
13
Cargo.toml
Normal 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
14
src/lib.rs
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user