diff options
| author | Rune Tynan <runetynan@gmail.com> | 2021-01-25 16:23:43 -0500 |
|---|---|---|
| committer | Rune Tynan <runetynan@gmail.com> | 2021-01-27 18:58:44 -0500 |
| commit | 67b78a027111090feccc8434ce9634c9f65ec34d (patch) | |
| tree | 92475dfcd08e916d095bdd92f52bee465e54138a | |
| parent | 3076e255fee458e1f5920c079b62cb2b26e6dce1 (diff) | |
| download | rust-67b78a027111090feccc8434ce9634c9f65ec34d.tar.gz rust-67b78a027111090feccc8434ce9634c9f65ec34d.zip | |
Update crate name and add README
| -rw-r--r-- | Cargo.lock | 16 | ||||
| -rw-r--r-- | src/librustdoc/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/json/mod.rs | 2 | ||||
| -rw-r--r-- | src/rustdoc-json-types/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/rustdoc-json-types/README.md | 12 |
6 files changed, 24 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock index d5c7d04797a..8a50e84340d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1638,13 +1638,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92c245af8786f6ac35f95ca14feca9119e71339aaab41e878e7cdd655c97e9e5" [[package]] -name = "json-types" -version = "0.1.0" -dependencies = [ - "serde", -] - -[[package]] name = "jsondocck" version = "0.1.0" dependencies = [ @@ -4393,11 +4386,11 @@ version = "0.0.0" dependencies = [ "expect-test", "itertools 0.9.0", - "json-types", "minifier", "pulldown-cmark 0.8.0", "regex", "rustc-rayon", + "rustdoc-json-types", "serde", "serde_json", "smallvec 1.4.2", @@ -4405,6 +4398,13 @@ dependencies = [ ] [[package]] +name = "rustdoc-json-types" +version = "0.1.0" +dependencies = [ + "serde", +] + +[[package]] name = "rustdoc-themes" version = "0.1.0" diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index c33482251ed..db64b31f31c 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -17,7 +17,7 @@ smallvec = "1.0" tempfile = "3" itertools = "0.9" regex = "1" -json-types = { path = "../rustdoc-json-types" } +rustdoc-json-types = { path = "../rustdoc-json-types" } [dev-dependencies] expect-test = "1.0" diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 9b0603c4d55..b2e5c8834b8 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -9,7 +9,7 @@ use rustc_hir::def::CtorKind; use rustc_span::def_id::{DefId, CRATE_DEF_INDEX}; use rustc_span::Pos; -use json_types::*; +use rustdoc_json_types::*; use crate::clean; use crate::formats::item_type::ItemType; diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index 06521f25873..a7c875fb748 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -16,7 +16,7 @@ use rustc_middle::ty::TyCtxt; use rustc_session::Session; use rustc_span::edition::Edition; -use json_types as types; +use rustdoc_json_types as types; use crate::clean; use crate::config::{RenderInfo, RenderOptions}; diff --git a/src/rustdoc-json-types/Cargo.toml b/src/rustdoc-json-types/Cargo.toml index b9c97c31c18..7bba16a68b9 100644 --- a/src/rustdoc-json-types/Cargo.toml +++ b/src/rustdoc-json-types/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "json-types" +name = "rustdoc-json-types" version = "0.1.0" authors = ["The Rust Project Developers"] edition = "2018" diff --git a/src/rustdoc-json-types/README.md b/src/rustdoc-json-types/README.md new file mode 100644 index 00000000000..17894c3c61d --- /dev/null +++ b/src/rustdoc-json-types/README.md @@ -0,0 +1,12 @@ +# Rustdoc JSON Types + +This crate exposes the Rustdoc JSON API as a set of types with serde implementations. +These types are part of the public interface of the rustdoc JSON output, and making them +their own crate allows them to be versioned and distributed without having to depend on +any rustc/rustdoc internals. This way, consumers can rely on this crate for both documentation +of the output, and as a way to read the output easily, and its versioning is intended to +follow semver guarantees about the version of the format. JSON format X will always be +compatible with rustdoc-json-types version N. + +Currently, this crate is only used by rustdoc itself. Upon the stabilization of +rustdoc-json, it may be start to be distributed separately for consumers of the API. |
