Cargo: 依存関係で機能を条件付きで有効にする方法を文書化する

作成日 2018年03月07日  ·  3コメント  ·  ソース: rust-lang/cargo

featuresセクションの/構文は、文書化されていないようです。

A-documenting-cargo-itself

最も参考になるコメント

ここにグーグルで来る他の人のために:

[dependencies]
othercrate = "1.2.3"

[features]
myfeature = ["othercrate/otherfeature"]

全てのコメント3件

ここにグーグルで来る他の人のために:

[dependencies]
othercrate = "1.2.3"

[features]
myfeature = ["othercrate/otherfeature"]

それは...ですか? マニフェストリファレンスドキュメント(リンク)の[features]セクションには、次の例があります。

# Features can be used to reexport features of other packages. The `session`
# feature of package `awesome` will ensure that the `session` feature of the
# package `cookie` is also enabled.
session = ["cookie/session"]

(これは、#712での機能の開始以来存在しています)

これを見逃したことを楽観的に締めくくりました(mdbook検索は3月にはなかったと思います)。 それでも作業が必要な場合は、再開できます。

cookieがオプションの場合、これはどのように機能しますか?

このページは役に立ちましたか?
0 / 5 - 0 評価