Skip to content

Commit 6cbc4c2

Browse files
committed
Update crate name and add README
1 parent 36284a3 commit 6cbc4c2

File tree

6 files changed

+24
-12
lines changed

6 files changed

+24
-12
lines changed

Cargo.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -1636,13 +1636,6 @@ version = "0.11.15"
16361636
source = "registry+https://github.com/rust-lang/crates.io-index"
16371637
checksum = "92c245af8786f6ac35f95ca14feca9119e71339aaab41e878e7cdd655c97e9e5"
16381638

1639-
[[package]]
1640-
name = "json-types"
1641-
version = "0.1.0"
1642-
dependencies = [
1643-
"serde",
1644-
]
1645-
16461639
[[package]]
16471640
name = "jsondocck"
16481641
version = "0.1.0"
@@ -4394,17 +4387,24 @@ version = "0.0.0"
43944387
dependencies = [
43954388
"expect-test",
43964389
"itertools 0.9.0",
4397-
"json-types",
43984390
"minifier",
43994391
"pulldown-cmark 0.8.0",
44004392
"regex",
44014393
"rustc-rayon",
4394+
"rustdoc-json-types",
44024395
"serde",
44034396
"serde_json",
44044397
"smallvec 1.4.2",
44054398
"tempfile",
44064399
]
44074400

4401+
[[package]]
4402+
name = "rustdoc-json-types"
4403+
version = "0.1.0"
4404+
dependencies = [
4405+
"serde",
4406+
]
4407+
44084408
[[package]]
44094409
name = "rustdoc-themes"
44104410
version = "0.1.0"

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ smallvec = "1.0"
1717
tempfile = "3"
1818
itertools = "0.9"
1919
regex = "1"
20-
json-types = { path = "../rustdoc-json-types" }
20+
rustdoc-json-types = { path = "../rustdoc-json-types" }
2121

2222
[dev-dependencies]
2323
expect-test = "1.0"

src/librustdoc/json/conversions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_hir::def::CtorKind;
99
use rustc_span::def_id::{DefId, CRATE_DEF_INDEX};
1010
use rustc_span::Pos;
1111

12-
use json_types::*;
12+
use rustdoc_json_types::*;
1313

1414
use crate::clean;
1515
use crate::formats::item_type::ItemType;

src/librustdoc/json/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_middle::ty::TyCtxt;
1616
use rustc_session::Session;
1717
use rustc_span::edition::Edition;
1818

19-
use json_types as types;
19+
use rustdoc_json_types as types;
2020

2121
use crate::clean;
2222
use crate::config::{RenderInfo, RenderOptions};

src/rustdoc-json-types/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "json-types"
2+
name = "rustdoc-json-types"
33
version = "0.1.0"
44
authors = ["The Rust Project Developers"]
55
edition = "2018"

src/rustdoc-json-types/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Rustdoc JSON Types
2+
3+
This crate exposes the Rustdoc JSON API as a set of types with serde implementations.
4+
These types are part of the public interface of the rustdoc JSON output, and making them
5+
their own crate allows them to be versioned and distributed without having to depend on
6+
any rustc/rustdoc internals. This way, consumers can rely on this crate for both documentation
7+
of the output, and as a way to read the output easily, and its versioning is intended to
8+
follow semver guarantees about the version of the format. JSON format X will always be
9+
compatible with rustdoc-json-types version N.
10+
11+
Currently, this crate is only used by rustdoc itself. Upon the stabilization of
12+
rustdoc-json, it may be start to be distributed separately for consumers of the API.

0 commit comments

Comments
 (0)