about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-12-19 14:21:00 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2021-01-02 16:55:12 +0100
commitc4739bc920a192b852ceb48fb500831594d5ff96 (patch)
tree0fb239e7a34923fc12b61a80c08a6b04ad559427
parent90ccf4f5adfb2562fc95c996b97faac7775a34bb (diff)
downloadrust-c4739bc920a192b852ceb48fb500831594d5ff96.tar.gz
rust-c4739bc920a192b852ceb48fb500831594d5ff96.zip
Rework DocFragment
-rw-r--r--src/librustdoc/clean/types.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index d0d37046e59..5c5ad5d7ccf 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -481,7 +481,7 @@ crate enum DocFragmentKind {
     RawDoc,
     /// A doc fragment created from a `#[doc(include="filename")]` attribute. Contains both the
     /// given filename and the file contents.
-    Include { filename: String },
+    Include { filename: Symbol },
 }
 
 impl<'a> FromIterator<&'a DocFragment> for String {
@@ -565,7 +565,7 @@ impl Attributes {
     /// Reads a `MetaItem` from within an attribute, looks for whether it is a
     /// `#[doc(include="file")]`, and returns the filename and contents of the file as loaded from
     /// its expansion.
-    crate fn extract_include(mi: &ast::MetaItem) -> Option<(String, String)> {
+    crate fn extract_include(mi: &ast::MetaItem) -> Option<(Symbol, String)> {
         mi.meta_item_list().and_then(|list| {
             for meta in list {
                 if meta.has_name(sym::include) {
@@ -573,13 +573,13 @@ impl Attributes {
                     // `#[doc(include(file="filename", contents="file contents")]` so we need to
                     // look for that instead
                     return meta.meta_item_list().and_then(|list| {
-                        let mut filename: Option<String> = None;
+                        let mut filename: Option<Symbol> = None;
                         let mut contents: Option<String> = None;
 
                         for it in list {
                             if it.has_name(sym::file) {
                                 if let Some(name) = it.value_str() {
-                                    filename = Some(name.to_string());
+                                    filename = Some(name);
                                 }
                             } else if it.has_name(sym::contents) {
                                 if let Some(docs) = it.value_str() {