小编Vee*_*mas的帖子

如何编辑Cargo.toml以便在我的Cargo包中包含资源文件?

我想用纯文本格式将单词列表与我的Cargo包捆绑在一起.我可以编辑Cargo.toml来执行此操作吗?

如果我使用npm,我会将其添加到我的package.json:

"files": ["data/my_dictionary.txt"]
Run Code Online (Sandbox Code Playgroud)

我试过include但它似乎没有用.

这是我的Cargo.toml

[package]

name = "chamkho"
version = "0.0.2"
authors = ["Vee Satayamas <vsatayamas@gmail.com>"]
test = true
description = "Thai word segmentation/breaking library and command line"
documentation = "https://github.com/veer66/chamkho/blob/master/README.md"
homepage = "https://github.com/veer66/chamkho/"
repository = "https://github.com/veer66/chamkho.git"
readme = "README.md"
keywords = ["text", "nlp", "thai", "library"]
license = "BSD-2-Clause"
include = ["**/*.txt", "**/*.rs","Cargo.toml"]

[[bin]]
name = "wordcut"
path = "src/cli.rs"
Run Code Online (Sandbox Code Playgroud)

这是输出 cargo package -l

Cargo.toml
src/acc.rs
src/cli.rs
src/dict.rs
src/edge.rs
src/graph.rs
src/graph_builder.rs
src/lib.rs
src/space_acc.rs
src/wordcut.rs
tests/wordcut.rs
Run Code Online (Sandbox Code Playgroud)

rust rust-cargo

5
推荐指数
1
解决办法
1413
查看次数

我可以添加一个git存储库中子目录的依赖包吗?

我想使用EDN解析器,但它位于https://github.com/mozilla/mentat中.https://github.com/mozilla/mentat/tree/master/edn有自己的Cargo.toml.

我试过这个:

[dependencies]
edn = { git = "https://github.com/mozilla/mentat/tree/master/edn" }
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

是否可以在mentat存储库中向此包添加依赖项?

git rust rust-cargo

3
推荐指数
1
解决办法
526
查看次数

OCaml 的记录是否有类似于 JavaScript 的扩展运算符?

我想知道 OCaml 是否可以执行类似于以下代码(在 TypeScript 中)的操作:

interface User {
  name: string
  email: string
}

function titi(user: User) {
  console.log(user)
}

let u1 = {name: "v2"}
let u2 = {...u1, email: "v2@x.y.z"}

titi(u2)
Run Code Online (Sandbox Code Playgroud)

ocaml

2
推荐指数
1
解决办法
178
查看次数

标签 统计

rust ×2

rust-cargo ×2

git ×1

ocaml ×1