Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::cell::RefCell;
use std::default::Default;
use std::fmt::Write;
use std::hash::Hash;
use std::lazy::SyncOnceCell as OnceCell;
use std::path::PathBuf;
Expand Down Expand Up @@ -40,6 +41,7 @@ use crate::formats::cache::Cache;
use crate::formats::item_type::ItemType;
use crate::html::render::cache::ExternalLocation;
use crate::html::render::Context;
use crate::passes::collect_intra_doc_links::UrlFragment;

crate use self::FnRetTy::*;
crate use self::ItemKind::*;
Expand Down Expand Up @@ -485,8 +487,7 @@ impl Item {
if let Ok((mut href, ..)) = href(*did, cx) {
debug!(?href);
if let Some(ref fragment) = *fragment {
href.push('#');
href.push_str(fragment);
write!(href, "{}", fragment).unwrap()
}
Some(RenderedLink {
original_text: s.clone(),
Expand Down Expand Up @@ -977,7 +978,7 @@ crate struct ItemLink {
pub(crate) link_text: String,
pub(crate) did: DefId,
/// The url fragment to append to the link
pub(crate) fragment: Option<String>,
pub(crate) fragment: Option<UrlFragment>,
}

pub struct RenderedLink {
Expand Down
Loading