From 98226db6cb8ebe2480ae2db909b4c44345c76cc0 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 8 Oct 2019 16:37:38 +0200 Subject: [PATCH] add_package: treat proc-macros as libraries Before this commit crates containing only proc-macros weren't documented, as docs.rs treated them as binaries. Proc macros are supposed to be documented though, and that behavior was a regression of the rustwide deployment. This commit fixes the regression by treating proc macros as libraries. --- src/db/add_package.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/add_package.rs b/src/db/add_package.rs index 08e75d3f6..358ff8b9f 100644 --- a/src/db/add_package.rs +++ b/src/db/add_package.rs @@ -38,7 +38,7 @@ pub(crate) fn add_package_into_database(conn: &Connection, let readme = get_readme(metadata_pkg, source_dir).unwrap_or(None); let (release_time, yanked, downloads) = try!(get_release_time_yanked_downloads(metadata_pkg)); let is_library = match metadata_pkg.targets[0].kind.as_slice() { - &[ref kind] if kind == "lib" => true, + &[ref kind] if kind == "lib" || kind == "proc-macro" => true, _ => false, }; let metadata = Metadata::from_source_dir(source_dir)?;