]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/codemap.rs
rollup merge of #21830: japaric/for-cleanup
[rust.git] / src / libsyntax / codemap.rs
index 13b6a7a037a6c01f0ea268ca88b705be4ebf7e96..00857d10f439e763e4cdb3af4cbf160d09f0fc39 100644 (file)
@@ -453,7 +453,7 @@ pub fn span_to_snippet(&self, sp: Span) -> Option<String> {
     }
 
     pub fn get_filemap(&self, filename: &str) -> Rc<FileMap> {
-        for fm in self.files.borrow().iter() {
+        for fm in &*self.files.borrow() {
             if filename == fm.name {
                 return fm.clone();
             }
@@ -477,7 +477,7 @@ pub fn bytepos_to_file_charpos(&self, bpos: BytePos) -> CharPos {
         // The number of extra bytes due to multibyte chars in the FileMap
         let mut total_extra_bytes = 0;
 
-        for mbc in map.multibyte_chars.borrow().iter() {
+        for mbc in &*map.multibyte_chars.borrow() {
             debug!("{}-byte char at {:?}", mbc.bytes, mbc.pos);
             if mbc.pos < bpos {
                 // every character is at least one byte, so we only