Skip to content

Commit

Permalink
Merge pull request #9 from emilio/bye-env-logger
Browse files Browse the repository at this point in the history
Remove dependency on env_logger.
  • Loading branch information
jfkthame authored Nov 13, 2020
2 parents d0d2e86 + fb28c11 commit 578d705
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mapped_hyph"
description = "Hyphenation using precompiled memory-mapped tables"
version = "0.4.2"
version = "0.4.3"
authors = ["Jonathan Kew <[email protected]>"]
license = "MIT/Apache-2.0"
edition = "2018"
Expand All @@ -10,7 +10,6 @@ edition = "2018"
memmap = "0.7.0"
arrayref = "0.3.5"
log = "0.4"
env_logger = "0.7.1"

[dev-dependencies]
criterion = "0.3"
Expand Down
21 changes: 19 additions & 2 deletions src/bin/hyf_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,31 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate log;
extern crate mapped_hyph;
extern crate env_logger;

use std::env;
use std::fs::File;

struct Logger {}

impl log::Log for Logger {
fn enabled(&self, _: &log::Metadata) -> bool {
true
}

fn log(&self, record: &log::Record) {
eprintln!("{} - {}", record.level(), record.args());
}

fn flush(&self) {}
}

static LOGGER: Logger = Logger {};

fn main() -> std::io::Result<()> {
env_logger::init();
unsafe { log::set_logger_racy(&LOGGER).unwrap() };

let args: Vec<String> = env::args().collect();
if args.len() == 3 {
let in_file = File::open(&args[1])?;
Expand Down

0 comments on commit 578d705

Please sign in to comment.