Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ readme = "README.md"
keywords = ["unification", "union-find"]

[features]
std = [ ]
bench = [ ]
persistent = [ "dogged" ]
persistent = [ "std", "dogged" ]

[dependencies]
dogged = { version = "0.2.0", optional = true }
log = "0.4"
log = { version = "0.4", optional = true }
301 changes: 0 additions & 301 deletions src/bitvec.rs

This file was deleted.

15 changes: 13 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,26 @@

//! An implementation of union-find. See the `unify` module for more
//! details.

#![cfg_attr(feature = "bench", feature(test))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
extern crate core;
extern crate alloc;

#[macro_use]
#[cfg(feature = "log")]
extern crate log;

#[cfg(feature = "persistent")]
extern crate dogged;

macro_rules! debug {
($($tt:tt)*) => {
#[cfg(feature = "log")]
log::debug!($($tt)*);
};
}

pub mod snapshot_vec;
pub mod undo_log;
pub mod unify;
9 changes: 5 additions & 4 deletions src/snapshot_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@

use self::UndoLog::*;

use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ops;
use core::fmt;
use core::marker::PhantomData;
use core::mem;
use core::ops;
use alloc::vec::Vec;

use undo_log::{Rollback, Snapshots, UndoLogs, VecLog};

Expand Down
5 changes: 4 additions & 1 deletion src/undo_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
//! Since the `*Storage` variants do not have an undo log `with_log` must be called with the
//! unified log before any mutating actions.

use core::ops;
use alloc::vec::Vec;

/// A trait which allows undo actions (`T`) to be pushed which can be used to rollback actio at a
/// later time if needed.
///
Expand Down Expand Up @@ -220,7 +223,7 @@ impl<T> VecLog<T> {
}
}

impl<T> std::ops::Index<usize> for VecLog<T> {
impl<T> ops::Index<usize> for VecLog<T> {
type Output = T;
fn index(&self, key: usize) -> &T {
&self.log[key]
Expand Down
5 changes: 3 additions & 2 deletions src/unify/backing_vec.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#[cfg(feature = "persistent")]
use dogged::DVec;
use snapshot_vec as sv;
use std::marker::PhantomData;
use std::ops::{self, Range};
use core::marker::PhantomData;
use core::ops::{self, Range};
use alloc::vec::Vec;

use undo_log::{Rollback, Snapshots, UndoLogs, VecLog};

Expand Down
Loading