Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
fix(syntex_syntax): Update to compile on rust 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
erickt committed Feb 28, 2016
1 parent 5b2e4e0 commit 6e617fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sudo: false
language: rust
rust:
- rust-1.5.0
- stable
- beta
- nightly
Expand Down
2 changes: 1 addition & 1 deletion syntex_syntax/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "syntex_syntax"
version = "0.29.0"
version = "0.29.1"
authors = [ "erick.tryzelaar@gmail.com" ]
license = "MIT/Apache-2.0"
description = "Export of libsyntax for code generation"
Expand Down
10 changes: 6 additions & 4 deletions syntex_syntax/src/codemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,16 @@ impl CodeMap {

/// Creates a new filemap without setting its line information. If you don't
/// intend to set the line information yourself, you should use new_filemap_and_lines.
pub fn new_filemap(&self, filename: FileName, mut src: String) -> Rc<FileMap> {
pub fn new_filemap(&self, filename: FileName, src: String) -> Rc<FileMap> {
let start_pos = self.next_start_pos();
let mut files = self.files.borrow_mut();

// Remove utf-8 BOM if any.
if src.starts_with("\u{feff}") {
src.drain(..3);
}
let src = if src.starts_with("\u{feff}") {
String::from(&src[3..])
} else {
src
};

let end_pos = start_pos + src.len();

Expand Down

0 comments on commit 6e617fd

Please sign in to comment.