]> git.lizzy.rs Git - rust.git/commitdiff
give render_text a generic return type
authorQuietMisdreavus <grey@quietmisdreavus.net>
Thu, 21 Dec 2017 21:15:48 +0000 (15:15 -0600)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 22 Jan 2018 09:51:28 +0000 (15:21 +0530)
src/librustdoc/html/render.rs

index cfa09ea30a8bed4ade5937c639383776767da02a..f335e073d56911ad59e801ee189c020adf37418f 100644 (file)
@@ -421,7 +421,7 @@ fn to_json(&self) -> Json {
 thread_local!(pub static USED_ID_MAP: RefCell<FxHashMap<String, usize>> =
                     RefCell::new(init_ids()));
 
-pub fn render_text<F: FnMut(RenderType) -> String>(mut render: F) -> (String, String) {
+pub fn render_text<T, F: FnMut(RenderType) -> T>(mut render: F) -> (T, T) {
     // Save the state of USED_ID_MAP so it only gets updated once even
     // though we're rendering twice.
     let orig_used_id_map = USED_ID_MAP.with(|map| map.borrow().clone());