canyon 0.1.1

A simple Rust library with an add function
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 7.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • canyon-project/canyon
    172 26 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • travzhang

canyon

一个简单的 Rust 库,提供了一个 add 函数。

功能

  • add(a, b): 将两个数字相加

使用方法

在你的 Cargo.toml 中添加:

[dependencies]
canyon = "0.1.0"

然后在代码中使用:

use canyon::add;

fn main() {
    let result = add(2, 3);
    println!("2 + 3 = {}", result); // 输出: 2 + 3 = 5
}

文档

本地生成文档

# 生成文档并在浏览器中打开
cargo doc --open

# 或者只生成文档
cargo doc --no-deps

文档会生成在 target/doc/canyon/index.html

在线文档

发布到 crates.io 后,文档会自动在 docs.rs 上可用:

发布到 crates.io

  1. 在 crates.io 上获取 API token
  2. 在 GitHub 仓库的 Settings > Secrets 中添加 CARGO_REGISTRY_TOKEN
  3. 推送到 main 分支,GitHub Action 会自动发布到 crates.io
  4. 发布后,docs.rs 会在几分钟内自动构建并托管文档