From 02105e7e18df5213b97ac7a3994ed0efac2bbd6d Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Mon, 24 Aug 2020 08:26:55 -0400 Subject: [PATCH] Rename metadata -> docsrs_metadata --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 2 +- src/docbuilder/metadata/Cargo.toml | 2 +- src/docbuilder/mod.rs | 1 - src/docbuilder/rustwide_builder.rs | 7 +++---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8fe32e0f..b2ac9e5b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -359,6 +359,7 @@ dependencies = [ "crates-index 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "crates-index-diff 7.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "docsrs-metadata 0.1.0", "dotenv 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -368,7 +369,6 @@ dependencies = [ "kuchiki 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lol_html 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "metadata 0.1.0", "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -626,6 +626,14 @@ name = "discard" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "docsrs-metadata" +version = "0.1.0" +dependencies = [ + "thiserror 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -1482,14 +1490,6 @@ dependencies = [ "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "metadata" -version = "0.1.0" -dependencies = [ - "thiserror 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "mime" version = "0.2.6" diff --git a/Cargo.toml b/Cargo.toml index 0e41b7c6f..14fd1e526 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ r2d2_postgres = "0.16" # url@2 for other usecases url = { version = "2.1.1", features = ["serde"] } badge = { path = "src/web/badge" } -metadata = { path = "src/docbuilder/metadata" } +docsrs-metadata = { path = "src/docbuilder/metadata" } backtrace = "0.3" failure = { version = "0.1.3", features = ["backtrace"] } comrak = { version = "0.8", default-features = false } diff --git a/src/docbuilder/metadata/Cargo.toml b/src/docbuilder/metadata/Cargo.toml index d54e3931a..3d09843d5 100644 --- a/src/docbuilder/metadata/Cargo.toml +++ b/src/docbuilder/metadata/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "metadata" +name = "docsrs-metadata" version = "0.1.0" authors = ["Joshua Nelson "] edition = "2018" diff --git a/src/docbuilder/mod.rs b/src/docbuilder/mod.rs index a2c7e2f0a..220ad062e 100644 --- a/src/docbuilder/mod.rs +++ b/src/docbuilder/mod.rs @@ -7,7 +7,6 @@ mod rustwide_builder; pub(crate) use self::limits::Limits; pub use self::rustwide_builder::RustwideBuilder; pub(crate) use self::rustwide_builder::{BuildResult, DocCoverage}; -use metadata::Metadata; use crate::db::Pool; use crate::error::Result; diff --git a/src/docbuilder/rustwide_builder.rs b/src/docbuilder/rustwide_builder.rs index dc1f03fa7..ecfc8dec7 100644 --- a/src/docbuilder/rustwide_builder.rs +++ b/src/docbuilder/rustwide_builder.rs @@ -1,5 +1,4 @@ use super::DocBuilder; -use super::Metadata; use crate::db::blacklist::is_blacklisted; use crate::db::file::add_path_into_database; use crate::db::{ @@ -12,9 +11,9 @@ use crate::index::api::ReleaseData; use crate::storage::CompressionAlgorithms; use crate::utils::{copy_doc_dir, parse_rustc_version, CargoMetadata}; use crate::{Metrics, Storage}; +use docsrs_metadata::{Metadata, DEFAULT_TARGETS, HOST_TARGET}; use failure::ResultExt; use log::{debug, info, warn, LevelFilter}; -use metadata::{DEFAULT_TARGETS, HOST_TARGET}; use rustwide::cmd::{Command, SandboxBuilder}; use rustwide::logging::{self, LogStorage}; use rustwide::toolchain::ToolchainError; @@ -338,7 +337,7 @@ impl RustwideBuilder { let res = build_dir .build(&self.toolchain, &krate, self.prepare_sandbox(&limits)) .run(|build| { - use metadata::BuildTargets; + use docsrs_metadata::BuildTargets; let mut has_docs = false; let mut successful_targets = Vec::new(); @@ -589,7 +588,7 @@ impl RustwideBuilder { rustdoc_flags_extras: Vec, ) -> Result> { // If the explicit target is not a tier one target, we need to install it. - if !metadata::DEFAULT_TARGETS.contains(&target) { + if !docsrs_metadata::DEFAULT_TARGETS.contains(&target) { // This is a no-op if the target is already installed. self.toolchain.add_target(&self.workspace, target)?; }