Factor out a lib.rs

This makes it easier for us to use tools that require a library, such
as criterion.
edge_only_predecessors
Wilfred Hughes 2021-09-13 00:39:51 +07:00
parent ea3cb7737a
commit 7fa9b29e4d
3 changed files with 24 additions and 16 deletions

@ -26,6 +26,12 @@ Optimised Dijkstra implementation, improving runtime performance.
Side-by-side displays now uses the same width for the left and right
columns, regardless of the content.
### Internals
Difftastic is now a library with a main binary. No APIs are considered
stable for external usage. This is intended to make benchmarking
easier.
## 0.8
### Git integration

@ -3,25 +3,13 @@ use mimalloc::MiMalloc;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
mod dijkstra;
mod files;
mod graph;
mod inline;
mod intervals;
mod line_parser;
mod lines;
mod positions;
mod regex_parser;
mod side_by_side;
mod style;
mod syntax;
mod tree_sitter_parser;
use atty::Stream;
use clap::{crate_version, App, AppSettings, Arg};
use std::{env, ffi::OsStr, path::Path};
use typed_arena::Arena;
use crate::{
use difftastic::*;
use difftastic::{
dijkstra::mark_syntax,
files::{is_probably_binary, read_or_die},
lines::{join_overlapping, visible_groups, MaxLine},
@ -30,8 +18,6 @@ use crate::{
};
extern crate pretty_env_logger;
#[macro_use]
extern crate log;
fn configure_color() {
if atty::is(Stream::Stdout) || env::var("GIT_PAGER_IN_USE").is_ok() {

@ -0,0 +1,16 @@
pub mod dijkstra;
pub mod files;
mod graph;
pub mod inline;
mod intervals;
pub mod line_parser;
pub mod lines;
mod positions;
pub mod regex_parser;
pub mod side_by_side;
pub mod style;
pub mod syntax;
pub mod tree_sitter_parser;
#[macro_use]
extern crate log;