From 97d831e0546f33f8fe325831ac6fb818a2f89ebf Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Fri, 30 Mar 2018 08:53:59 -0700 Subject: [PATCH] move strutil to base crate I plan to use strutil::hex in db/auth.rs. --- base/lib.rs | 1 + {src => base}/strutil.rs | 0 src/main.rs | 1 - src/mp4.rs | 4 ++-- src/web.rs | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename {src => base}/strutil.rs (100%) diff --git a/base/lib.rs b/base/lib.rs index 3c9ea0b..d97202a 100644 --- a/base/lib.rs +++ b/base/lib.rs @@ -35,3 +35,4 @@ extern crate parking_lot; extern crate time; pub mod clock; +pub mod strutil; diff --git a/src/strutil.rs b/base/strutil.rs similarity index 100% rename from src/strutil.rs rename to base/strutil.rs diff --git a/src/main.rs b/src/main.rs index 88f0e6f..dff6b29 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,7 +72,6 @@ mod mp4; mod slices; mod stream; mod streamer; -mod strutil; mod web; /// Commandline usage string. This is in the particular format expected by the `docopt` crate. diff --git a/src/mp4.rs b/src/mp4.rs index ff485b1..d1e59ff 100644 --- a/src/mp4.rs +++ b/src/mp4.rs @@ -78,6 +78,7 @@ extern crate time; +use base::strutil; use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; use db::recording::{self, TIME_UNITS_PER_SEC}; use db::{self, dir}; @@ -98,7 +99,6 @@ use std::io; use std::ops::Range; use std::mem; use std::sync::Arc; -use strutil; /// This value should be incremented any time a change is made to this file that causes different /// bytes to be output for a particular set of `Mp4Builder` options. Incrementing this value will @@ -1517,6 +1517,7 @@ impl http_serve::Entity for File { /// to verify the output is byte-for-byte as expected. #[cfg(test)] mod tests { + use base::strutil; use byteorder::{BigEndian, ByteOrder}; use clock::RealClocks; use db::recording::{self, TIME_UNITS_PER_SEC}; @@ -1531,7 +1532,6 @@ mod tests { use std::ops::Range; use std::path::Path; use std::str; - use strutil; use super::*; use stream::{self, Opener, Stream}; diff --git a/src/web.rs b/src/web.rs index 6322e29..773fc3a 100644 --- a/src/web.rs +++ b/src/web.rs @@ -30,6 +30,7 @@ extern crate hyper; +use base::strutil; use core::borrow::Borrow; use core::str::FromStr; use db::{self, recording}; @@ -54,7 +55,6 @@ use std::fs; use std::ops::Range; use std::path::PathBuf; use std::sync::Arc; -use strutil; use url::form_urlencoded; use uuid::Uuid;