Skip to content

Commit 92f5e58

Browse files
Delete Rustbook step
There's no need to have it given it merely forwarded to RustbookSrc.
1 parent 96636f3 commit 92f5e58

File tree

1 file changed

+12
-34
lines changed

1 file changed

+12
-34
lines changed

src/bootstrap/doc.rs

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ macro_rules! book {
4646
}
4747

4848
fn run(self, builder: &Builder<'_>) {
49-
builder.ensure(Rustbook {
49+
builder.ensure(RustbookSrc {
5050
target: self.target,
5151
name: INTERNER.intern_str($book_name),
5252
version: $book_ver,
53+
src: doc_src(builder),
5354
})
5455
}
5556
}
@@ -75,35 +76,8 @@ enum RustbookVersion {
7576
MdBook2,
7677
}
7778

78-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
79-
struct Rustbook {
80-
target: Interned<String>,
81-
name: Interned<String>,
82-
version: RustbookVersion,
83-
}
84-
85-
impl Step for Rustbook {
86-
type Output = ();
87-
88-
// rustbook is never directly called, and only serves as a shim for the nomicon and the
89-
// reference.
90-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
91-
run.never()
92-
}
93-
94-
/// Invoke `rustbook` for `target` for the doc book `name`.
95-
///
96-
/// This will not actually generate any documentation if the documentation has
97-
/// already been generated.
98-
fn run(self, builder: &Builder<'_>) {
99-
let src = builder.src.join("src/doc");
100-
builder.ensure(RustbookSrc {
101-
target: self.target,
102-
name: self.name,
103-
src: INTERNER.intern_path(src),
104-
version: self.version,
105-
});
106-
}
79+
fn doc_src(builder: &Builder<'_>) -> Interned<PathBuf> {
80+
INTERNER.intern_path(builder.src.join("src/doc"))
10781
}
10882

10983
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -274,33 +248,37 @@ impl Step for TheBook {
274248
let name = self.name;
275249

276250
// build book
277-
builder.ensure(Rustbook {
251+
builder.ensure(RustbookSrc {
278252
target,
279253
name: INTERNER.intern_string(name.to_string()),
280254
version: RustbookVersion::MdBook2,
255+
src: doc_src(builder),
281256
});
282257

283258
// building older edition redirects
284259

285260
let source_name = format!("{}/first-edition", name);
286-
builder.ensure(Rustbook {
261+
builder.ensure(RustbookSrc {
287262
target,
288263
name: INTERNER.intern_string(source_name),
289264
version: RustbookVersion::MdBook2,
265+
src: doc_src(builder),
290266
});
291267

292268
let source_name = format!("{}/second-edition", name);
293-
builder.ensure(Rustbook {
269+
builder.ensure(RustbookSrc {
294270
target,
295271
name: INTERNER.intern_string(source_name),
296272
version: RustbookVersion::MdBook2,
273+
src: doc_src(builder),
297274
});
298275

299276
let source_name = format!("{}/2018-edition", name);
300-
builder.ensure(Rustbook {
277+
builder.ensure(RustbookSrc {
301278
target,
302279
name: INTERNER.intern_string(source_name),
303280
version: RustbookVersion::MdBook2,
281+
src: doc_src(builder),
304282
});
305283

306284
// build the version info page and CSS

0 commit comments

Comments
 (0)