Fix tidy
This commit is contained in:
parent
191e5b0b78
commit
c0af89723d
2 changed files with 9 additions and 5 deletions
|
@ -1440,7 +1440,8 @@ impl<'a> Resolver<'a> {
|
||||||
/// isn't something that can be returned because it can't be made to live that long,
|
/// isn't something that can be returned because it can't be made to live that long,
|
||||||
/// and also it's a private type. Fortunately rustdoc doesn't need to know the error,
|
/// and also it's a private type. Fortunately rustdoc doesn't need to know the error,
|
||||||
/// just that an error occured.
|
/// just that an error occured.
|
||||||
pub fn resolve_str_path_error(&mut self, span: Span, path_str: &str, is_value: bool) -> Result<hir::Path, ()> {
|
pub fn resolve_str_path_error(&mut self, span: Span, path_str: &str, is_value: bool)
|
||||||
|
-> Result<hir::Path, ()> {
|
||||||
use std::iter;
|
use std::iter;
|
||||||
let mut errored = false;
|
let mut errored = false;
|
||||||
|
|
||||||
|
|
|
@ -834,8 +834,9 @@ impl Clean<Attributes> for [ast::Attribute] {
|
||||||
let path = {
|
let path = {
|
||||||
let is_value;
|
let is_value;
|
||||||
let path_str = if let Some(prefix) =
|
let path_str = if let Some(prefix) =
|
||||||
["struct", "enum", "type", "trait", "union"].iter()
|
["struct", "enum", "type",
|
||||||
.find(|p| link.starts_with(**p)) {
|
"trait", "union"].iter()
|
||||||
|
.find(|p| link.starts_with(**p)) {
|
||||||
is_value = Some(false);
|
is_value = Some(false);
|
||||||
link.trim_left_matches(prefix).trim()
|
link.trim_left_matches(prefix).trim()
|
||||||
} else if let Some(prefix) =
|
} else if let Some(prefix) =
|
||||||
|
@ -857,7 +858,8 @@ impl Clean<Attributes> for [ast::Attribute] {
|
||||||
// avoid resolving things (i.e. regular links) which aren't like paths
|
// avoid resolving things (i.e. regular links) which aren't like paths
|
||||||
// FIXME(Manishearth) given that most links have slashes in them might be worth
|
// FIXME(Manishearth) given that most links have slashes in them might be worth
|
||||||
// doing a check for slashes first
|
// doing a check for slashes first
|
||||||
if path_str.contains(|ch: char| !(ch.is_alphanumeric() || ch == ':' || ch == '_')) {
|
if path_str.contains(|ch: char| !(ch.is_alphanumeric() ||
|
||||||
|
ch == ':' || ch == '_')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,7 +869,8 @@ impl Clean<Attributes> for [ast::Attribute] {
|
||||||
if let Some(id) = cx.mod_ids.borrow().last() {
|
if let Some(id) = cx.mod_ids.borrow().last() {
|
||||||
cx.resolver.borrow_mut()
|
cx.resolver.borrow_mut()
|
||||||
.with_scope(*id, |resolver| {
|
.with_scope(*id, |resolver| {
|
||||||
resolver.resolve_str_path_error(DUMMY_SP, &path_str, is_val)
|
resolver.resolve_str_path_error(DUMMY_SP,
|
||||||
|
&path_str, is_val)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// FIXME(Manishearth) this branch doesn't seem to ever be hit, really
|
// FIXME(Manishearth) this branch doesn't seem to ever be hit, really
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue