diff --git a/Cargo.lock b/Cargo.lock index 18e0369..006e91b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,6 +271,7 @@ dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyperjson 0.2.2", "pyo3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/profiling/Cargo.toml b/profiling/Cargo.toml index 276a12f..bdefd23 100644 --- a/profiling/Cargo.toml +++ b/profiling/Cargo.toml @@ -2,12 +2,14 @@ name = "profiling" version = "0.1.0" authors = ["Matthias Endler "] +edition = "2018" [dependencies] # Disabling the default features makes pyo3 choose binary linking hyperjson = { path = "..", default-features = false } structopt = "0.3.2" clap = "2.33.0" +serde_json = "1.0.40" [dependencies.pyo3] version = "0.8.0" diff --git a/profiling/src/main.rs b/profiling/src/main.rs index f94f1b8..b4fb939 100644 --- a/profiling/src/main.rs +++ b/profiling/src/main.rs @@ -14,16 +14,11 @@ //! callgrind_annotate --auto=yes callgrind.out.35583 >out.rs //! qcachegrind callgrind.out.35583 //! ``` -extern crate structopt; -#[macro_use] -extern crate clap; - -extern crate hyperjson; -extern crate pyo3; mod profiles; use structopt::StructOpt; +use clap::arg_enum; arg_enum! { #[derive(Debug)] diff --git a/src/lib.rs b/src/lib.rs index 5792271..0467715 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,22 +1,16 @@ #![feature(test)] -#[macro_use] -extern crate failure; -#[macro_use] -extern crate pyo3; -extern crate serde; -extern crate serde_derive; -extern crate serde_json; -extern crate test; - use std::collections::BTreeMap; use std::fmt; use std::marker::PhantomData; +use failure::Fail; use pyo3::prelude::*; use pyo3::exceptions::TypeError as PyTypeError; use pyo3::exceptions::ValueError as PyValueError; use pyo3::types::{PyDict, PyFloat, PyList, PyAny, PyTuple}; +use pyo3::{import_exception, wrap_pyfunction}; + use serde::de::{self, DeserializeSeed, Deserializer, MapAccess, SeqAccess, Visitor}; use serde::ser::{self, Serialize, SerializeMap, SerializeSeq, Serializer};