Skip to content

Commit

Permalink
Merge branch 'cargofmt'
Browse files Browse the repository at this point in the history
  • Loading branch information
djzin committed Dec 21, 2019
2 parents 42eaa6e + 354a0b4 commit 2385f5e
Show file tree
Hide file tree
Showing 7 changed files with 589 additions and 314 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Format
run: cargo fmt -- --check
- name: Build
run: cargo build --verbose
- name: Run tests
Expand Down
12 changes: 7 additions & 5 deletions examples/benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate parse_zoneinfo;

use parse_zoneinfo::line::{LineParser, Line};
use parse_zoneinfo::line::{Line, LineParser};
use parse_zoneinfo::table::TableBuilder;

// This function is needed until zoneinfo_parse handles comments correctly.
Expand All @@ -13,9 +13,11 @@ fn strip_comments(mut line: String) -> String {
}

fn main() {
let lines = std::fs::read_to_string("examples/asia").unwrap().lines().map(|line| {
strip_comments(line.to_string())
}).collect::<Vec<_>>();
let lines = std::fs::read_to_string("examples/asia")
.unwrap()
.lines()
.map(|line| strip_comments(line.to_string()))
.collect::<Vec<_>>();

for _ in 0..100 {
let parser = LineParser::new();
Expand All @@ -26,7 +28,7 @@ fn main() {
Line::Continuation(cont) => builder.add_continuation_line(cont).unwrap(),
Line::Rule(rule) => builder.add_rule_line(rule).unwrap(),
Line::Link(link) => builder.add_link_line(link).unwrap(),
Line::Space => {},
Line::Space => {}
}
}
let _table = builder.build();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate regex;

pub mod line;
pub mod structure;
pub mod table;
pub mod transitions;
pub mod structure;
Loading

0 comments on commit 2385f5e

Please sign in to comment.