Skip to content

Commit 91e021a

Browse files
Make some private methods public
1 parent db0e6cd commit 91e021a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/librustdoc/clean/types.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ pub struct Attributes {
431431

432432
impl Attributes {
433433
/// Extracts the content from an attribute `#[doc(cfg(content))]`.
434-
fn extract_cfg(mi: &ast::MetaItem) -> Option<&ast::MetaItem> {
434+
pub fn extract_cfg(mi: &ast::MetaItem) -> Option<&ast::MetaItem> {
435435
use syntax::ast::NestedMetaItem::MetaItem;
436436

437437
if let ast::MetaItemKind::List(ref nmis) = mi.kind {
@@ -456,7 +456,7 @@ impl Attributes {
456456
/// Reads a `MetaItem` from within an attribute, looks for whether it is a
457457
/// `#[doc(include="file")]`, and returns the filename and contents of the file as loaded from
458458
/// its expansion.
459-
fn extract_include(mi: &ast::MetaItem)
459+
pub fn extract_include(mi: &ast::MetaItem)
460460
-> Option<(String, String)>
461461
{
462462
mi.meta_item_list().and_then(|list| {
@@ -710,7 +710,7 @@ pub enum GenericBound {
710710
}
711711

712712
impl GenericBound {
713-
fn maybe_sized(cx: &DocContext<'_>) -> GenericBound {
713+
pub fn maybe_sized(cx: &DocContext<'_>) -> GenericBound {
714714
let did = cx.tcx.require_lang_item(lang_items::SizedTraitLangItem, None);
715715
let empty = cx.tcx.intern_substs(&[]);
716716
let path = external_path(cx, cx.tcx.item_name(did),
@@ -727,7 +727,7 @@ impl GenericBound {
727727
}, hir::TraitBoundModifier::Maybe)
728728
}
729729

730-
fn is_sized_bound(&self, cx: &DocContext<'_>) -> bool {
730+
pub fn is_sized_bound(&self, cx: &DocContext<'_>) -> bool {
731731
use rustc::hir::TraitBoundModifier as TBM;
732732
if let GenericBound::TraitBound(PolyTrait { ref trait_, .. }, TBM::None) = *self {
733733
if trait_.def_id() == cx.tcx.lang_items().sized_trait() {
@@ -737,14 +737,14 @@ impl GenericBound {
737737
false
738738
}
739739

740-
fn get_poly_trait(&self) -> Option<PolyTrait> {
740+
pub fn get_poly_trait(&self) -> Option<PolyTrait> {
741741
if let GenericBound::TraitBound(ref p, _) = *self {
742742
return Some(p.clone())
743743
}
744744
None
745745
}
746746

747-
fn get_trait_type(&self) -> Option<Type> {
747+
pub fn get_trait_type(&self) -> Option<Type> {
748748
if let GenericBound::TraitBound(PolyTrait { ref trait_, .. }, _) = *self {
749749
Some(trait_.clone())
750750
} else {
@@ -1205,7 +1205,7 @@ impl GetDefId for Type {
12051205
}
12061206

12071207
impl PrimitiveType {
1208-
fn from_str(s: &str) -> Option<PrimitiveType> {
1208+
pub fn from_str(s: &str) -> Option<PrimitiveType> {
12091209
match s {
12101210
"isize" => Some(PrimitiveType::Isize),
12111211
"i8" => Some(PrimitiveType::I8),

0 commit comments

Comments
 (0)