Skip to content

Commit cbd5458

Browse files
committed
refactor(cli/rustup-mode): move DocPage::name() to a separate impl block
1 parent c732674 commit cbd5458

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/cli/rustup_mode.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,10 +1425,6 @@ macro_rules! docs_data {
14251425
}
14261426

14271427
impl DocPage {
1428-
fn name(&self) -> Option<&'static str> {
1429-
Some(self.path()?.rsplit_once('/')?.0)
1430-
}
1431-
14321428
fn path(&self) -> Option<&'static str> {
14331429
$( if self.$ident { return Some($path); } )+
14341430
None
@@ -1466,6 +1462,12 @@ docs_data![
14661462
(unstable_book, "The Unstable Book", "unstable-book/index.html"),
14671463
];
14681464

1465+
impl DocPage {
1466+
fn name(&self) -> Option<&'static str> {
1467+
Some(self.path()?.rsplit_once('/')?.0)
1468+
}
1469+
}
1470+
14691471
async fn doc(
14701472
cfg: &Cfg<'_>,
14711473
path_only: bool,

0 commit comments

Comments
 (0)