summaryrefslogtreecommitdiffstats
path: root/rich_crate
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2019-04-09 01:36:17 +0100
committerKornel <kornel@geekhood.net>2019-04-09 14:37:31 +0100
commit5c387344c5fa0ed1f44b5034f366bd48e8cd08ba (patch)
tree300eb6861a2953da50eac8eebec9e4a65f1ebe31 /rich_crate
parent8a24a7b721829576e953010bef8409fa1d691705 (diff)
CoC
Diffstat (limited to 'rich_crate')
-rw-r--r--rich_crate/src/rich_crate_version.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/rich_crate/src/rich_crate_version.rs b/rich_crate/src/rich_crate_version.rs
index 5156915..1d37c5b 100644
--- a/rich_crate/src/rich_crate_version.rs
+++ b/rich_crate/src/rich_crate_version.rs
@@ -28,6 +28,7 @@ pub struct RichCrateVersion {
repo: Option<Repo>,
path_in_repo: Option<String>,
has_buildrs: bool,
+ has_code_of_conduct: bool,
has_examples: bool,
has_tests: bool,
has_benches: bool,
@@ -57,7 +58,7 @@ pub enum Include {
/// Crates.rs uses this only for the latest version of a crate.
impl RichCrateVersion {
pub fn new(index: Version, mut manifest: Manifest, derived: Derived, readme: Result<Option<Readme>, ()>,
- lib_file: Option<String>, path_in_repo: Option<String>, has_buildrs: bool) -> Self
+ lib_file: Option<String>, path_in_repo: Option<String>, has_buildrs: bool, has_code_of_conduct: bool) -> Self
{
let package = manifest.package.take().unwrap();
let mut s = Self {
@@ -68,6 +69,7 @@ impl RichCrateVersion {
package,
readme,
has_buildrs,
+ has_code_of_conduct,
derived,
path_in_repo,
lib_file,
@@ -286,6 +288,10 @@ impl RichCrateVersion {
self.has_buildrs || self.package.build.is_some()
}
+ pub fn has_code_of_conduct(&self) -> bool {
+ self.has_code_of_conduct
+ }
+
pub fn has_examples(&self) -> bool {
self.has_examples
}