diff options
| author | Alexis Beingessner <a.beingessner@gmail.com> | 2014-11-06 12:25:16 -0500 |
|---|---|---|
| committer | Alexis Beingessner <a.beingessner@gmail.com> | 2014-11-06 12:26:08 -0500 |
| commit | eec145be3f5e5f763e61749a6737f90df8504e05 (patch) | |
| tree | ff30ca7802a92034a30cb57dcf4c89733b2952b6 /src/librustdoc | |
| parent | cf3b2e4fe6044cce018b723de9b21c500c6eac41 (diff) | |
| download | rust-eec145be3f5e5f763e61749a6737f90df8504e05.tar.gz rust-eec145be3f5e5f763e61749a6737f90df8504e05.zip | |
Fallout from collection conventions
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/format.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 18 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index d87d8776d4a..545eeaf7406 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -45,7 +45,7 @@ pub fn try_inline(cx: &DocContext, id: ast::NodeId, into: Option<ast::Ident>) Some(tcx) => tcx, None => return None, }; - let def = match tcx.def_map.borrow().find(&id) { + let def = match tcx.def_map.borrow().get(&id) { Some(def) => *def, None => return None, }; @@ -223,7 +223,7 @@ fn build_impls(cx: &DocContext, tcx: &ty::ctxt, ty::populate_implementations_for_type_if_necessary(tcx, did); let mut impls = Vec::new(); - match tcx.inherent_impls.borrow().find(&did) { + match tcx.inherent_impls.borrow().get(&did) { None => {} Some(i) => { impls.extend(i.iter().map(|&did| { build_impl(cx, tcx, did) })); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index f96b3916f06..bd6c696ad74 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1395,7 +1395,7 @@ impl Clean<Item> for ty::field_ty { let (name, attrs) = if self.name == unnamed_field.name { (None, None) } else { - (Some(self.name), Some(attr_map.find(&self.id.node).unwrap())) + (Some(self.name), Some(attr_map.get(&self.id.node).unwrap())) }; let ty = ty::lookup_item_type(cx.tcx(), self.id); @@ -2090,7 +2090,7 @@ fn resolve_type(cx: &DocContext, path: Path, None => return Primitive(Bool), }; debug!("searching for {} in defmap", id); - let def = match tcx.def_map.borrow().find(&id) { + let def = match tcx.def_map.borrow().get(&id) { Some(&k) => k, None => panic!("unresolved id not in defmap") }; @@ -2159,7 +2159,7 @@ fn resolve_use_source(cx: &DocContext, path: Path, id: ast::NodeId) -> ImportSou fn resolve_def(cx: &DocContext, id: ast::NodeId) -> Option<ast::DefId> { cx.tcx_opt().and_then(|tcx| { - tcx.def_map.borrow().find(&id).map(|&def| register_def(cx, def)) + tcx.def_map.borrow().get(&id).map(|&def| register_def(cx, def)) }) } diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index f9177c8d615..320f84adea7 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -208,7 +208,7 @@ fn resolved_path(w: &mut fmt::Formatter, did: ast::DefId, p: &clean::Path, } }, |cache| { - match cache.paths.find(&did) { + match cache.paths.get(&did) { None => None, Some(&(ref fqp, shortty)) => Some((fqp.clone(), shortty)) } @@ -313,7 +313,7 @@ fn primitive_link(f: &mut fmt::Formatter, name: &str) -> fmt::Result { let m = cache_key.get().unwrap(); let mut needs_termination = false; - match m.primitive_locations.find(&prim) { + match m.primitive_locations.get(&prim) { Some(&ast::LOCAL_CRATE) => { let loc = current_location_key.get().unwrap(); let len = if loc.len() == 0 {0} else {loc.len() - 1}; diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 3f1590773aa..9dacee1652a 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -242,7 +242,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result { // Make sure our hyphenated ID is unique for this page let map = used_header_map.get().unwrap(); - let id = match map.borrow_mut().find_mut(&id) { + let id = match map.borrow_mut().get_mut(&id) { None => id, Some(a) => { *a += 1; format!("{}-{}", id, *a - 1) } }; diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 9af2b22adea..fbd2611acb9 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -389,7 +389,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::IoResult<String> // has since been learned. for &(pid, ref item) in orphan_methods.iter() { let did = ast_util::local_def(pid); - match paths.find(&did) { + match paths.get(&did) { Some(&(ref fqp, _)) => { search_index.push(IndexItem { ty: shortty(item), @@ -443,7 +443,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::IoResult<String> item.desc.to_json().to_string())); match item.parent { Some(nodeid) => { - let pathid = *nodeid_to_pathid.find(&nodeid).unwrap(); + let pathid = *nodeid_to_pathid.get(&nodeid).unwrap(); try!(write!(&mut w, ",{}", pathid)); } None => {} @@ -454,7 +454,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::IoResult<String> try!(write!(&mut w, r#"],"paths":["#)); for (i, &did) in pathid_to_nodeid.iter().enumerate() { - let &(ref fqp, short) = cache.paths.find(&did).unwrap(); + let &(ref fqp, short) = cache.paths.get(&did).unwrap(); if i > 0 { try!(write!(&mut w, ",")); } @@ -543,7 +543,7 @@ fn write_shared(cx: &Context, // // FIXME: this is a vague explanation for why this can't be a `get`, in // theory it should be... - let &(ref remote_path, remote_item_type) = match cache.paths.find(&did) { + let &(ref remote_path, remote_item_type) = match cache.paths.get(&did) { Some(p) => p, None => continue, }; @@ -838,7 +838,7 @@ impl DocFolder for Cache { } else { let last = self.parent_stack.last().unwrap(); let did = *last; - let path = match self.paths.find(&did) { + let path = match self.paths.get(&did) { Some(&(_, item_type::Trait)) => Some(self.stack[..self.stack.len() - 1]), // The current stack not necessarily has correlation for @@ -1170,7 +1170,7 @@ impl Context { &Item{ cx: cx, item: it })); } else { let mut url = "../".repeat(cx.current.len()); - match cache_key.get().unwrap().paths.find(&it.def_id) { + match cache_key.get().unwrap().paths.get(&it.def_id) { Some(&(ref names, _)) => { for name in names[..names.len() - 1].iter() { url.push_str(name.as_slice()); @@ -1735,7 +1735,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, <h2 id='implementors'>Implementors</h2> <ul class='item-list' id='implementors-list'> ")); - match cache.implementors.find(&it.def_id) { + match cache.implementors.get(&it.def_id) { Some(implementors) => { for i in implementors.iter() { try!(writeln!(w, "<li>{}<code>impl{} {} for {}{}</code></li>", @@ -1992,7 +1992,7 @@ fn render_struct(w: &mut fmt::Formatter, it: &clean::Item, } fn render_methods(w: &mut fmt::Formatter, it: &clean::Item) -> fmt::Result { - match cache_key.get().unwrap().impls.find(&it.def_id) { + match cache_key.get().unwrap().impls.get(&it.def_id) { Some(v) => { let (non_trait, traits) = v.partitioned(|i| i.impl_.trait_.is_none()); if non_trait.len() > 0 { @@ -2080,7 +2080,7 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl) -> fmt::Result { match i.impl_.trait_ { Some(clean::ResolvedPath { did, .. }) => { try!({ - match cache_key.get().unwrap().traits.find(&did) { + match cache_key.get().unwrap().traits.get(&did) { Some(t) => try!(render_default_methods(w, t, &i.impl_)), None => {} } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index bd3c618a5ed..5e2f56e00fc 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -417,7 +417,7 @@ fn json_input(input: &str) -> Result<Output, String> { Ok(json::Object(obj)) => { let mut obj = obj; // Make sure the schema is what we expect - match obj.pop(&"schema".to_string()) { + match obj.remove(&"schema".to_string()) { Some(json::String(version)) => { if version.as_slice() != SCHEMA_VERSION { return Err(format!( @@ -428,7 +428,7 @@ fn json_input(input: &str) -> Result<Output, String> { Some(..) => return Err("malformed json".to_string()), None => return Err("expected a schema version".to_string()), } - let krate = match obj.pop(&"crate".to_string()) { + let krate = match obj.remove(&"crate".to_string()) { Some(json) => { let mut d = json::Decoder::new(json); Decodable::decode(&mut d).unwrap() |
