Skip to content

Commit 9e75f8b

Browse files
committed
Remove need for NLL - now compiles on 1.28.0
1 parent 9c19771 commit 9e75f8b

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ matrix:
55
- rust: stable
66
- rust: beta
77
- rust: nightly
8-
- rust: 1.17.0
9-
script: cargo build
10-
- rust: 1.24.1
8+
- rust: 1.28.0
119
- rust: nightly
1210
env: CLIPPY
1311
script: |

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
install:
2-
- ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-1.24.1-i686-pc-windows-gnu.exe'
3-
- rust-1.24.1-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
2+
- ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-1.28.0-i686-pc-windows-gnu.exe'
3+
- rust-1.28.0-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
44
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
55
- SET PATH=%PATH%;C:\MinGW\bin
66
- rustc -V

src/parser.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,23 +367,38 @@ impl<T: Iterator<Item = char>> Parser<T> {
367367
}
368368

369369
fn parser_process_directives(&mut self) -> Result<(), ScanError> {
370+
enum DirectiveAction {
371+
None,
372+
Tag { handle: String, prefix: String },
373+
}
374+
370375
loop {
371-
match self.peek_token()?.1 {
376+
// Without NLL, split the peek and the action
377+
let action = match self.peek_token()?.1 {
372378
TokenType::VersionDirective(_, _) => {
373379
// XXX parsing with warning according to spec
374380
//if major != 1 || minor > 2 {
375381
// return Err(ScanError::new(tok.0,
376382
// "found incompatible YAML document"));
377383
//}
384+
DirectiveAction::None
378385
}
379386
TokenType::TagDirective(ref handle, ref prefix) => {
380-
let handle = String::from(handle);
381-
let mut prefix = String::from(prefix);
387+
let handle = String::clone(handle);
388+
let mut prefix = String::clone(prefix);
382389
prefix.pop();
383-
self.tag_directives.insert(handle, prefix);
390+
DirectiveAction::Tag { handle, prefix }
384391
}
385392
_ => break,
393+
};
394+
395+
match action {
396+
DirectiveAction::Tag { handle, prefix } => {
397+
self.tag_directives.insert(handle, prefix);
398+
}
399+
_ => (),
386400
}
401+
387402
self.skip();
388403
}
389404
Ok(())

0 commit comments

Comments
 (0)