diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a44e65c..1277e6e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -62,6 +62,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust }} @@ -85,11 +93,19 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install nightly toolchain uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: stable override: true - name: Install cargo-tarpaulin diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..8aa338f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,158 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +dependencies = [ + "memchr", +] + +[[package]] +name = "bio-types" +version = "0.7.1-alpha.0" +dependencies = [ + "derive-new", + "lazy_static", + "quick-error", + "regex", + "serde", + "serde_derive", + "strum_macros", +] + +[[package]] +name = "derive-new" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f31892cd5c62e414316f2963c5689242c43d8e7bbcaaeca97e5e28c95d91d9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "heck" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", +] + +[[package]] +name = "regex-syntax" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" + +[[package]] +name = "serde" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" + +[[package]] +name = "serde_derive" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "strum_macros" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "unicode-segmentation" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" diff --git a/Cargo.toml b/Cargo.toml index 6b637d6..0bba310 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,8 @@ repository = "https://github.com/rust-bio/rust-bio" documentation = "https://docs.rs/bio" readme = "README.md" license = "MIT" +license-file = "LICENSE.md" +edition = "2018" [dependencies] diff --git a/src/annot/contig.rs b/src/annot/contig.rs index 1dbe100..45ced75 100644 --- a/src/annot/contig.rs +++ b/src/annot/contig.rs @@ -14,10 +14,10 @@ use std::str::FromStr; use regex::Regex; -use annot::loc::Loc; -use annot::pos::Pos; -use annot::*; -use strand::*; +use crate::annot::loc::Loc; +use crate::annot::pos::Pos; +use crate::annot::*; +use crate::strand::*; /// Contiguous sequence region on a particular, named sequence (e.g. a /// chromosome) diff --git a/src/annot/loc.rs b/src/annot/loc.rs index 5b87d78..f384705 100644 --- a/src/annot/loc.rs +++ b/src/annot/loc.rs @@ -8,10 +8,10 @@ use std::ops::Neg; -use annot::contig::Contig; -use annot::pos::Pos; +use crate::annot::contig::Contig; +use crate::annot::pos::Pos; -use strand::*; +use crate::strand::*; /// A trait for a sequence location -- a defined region on a named /// chromosome (or other reference sequence), which may also have @@ -80,7 +80,7 @@ pub trait Loc { Self::Strand: Into + Copy, T: Neg + Copy; - fn contig_intersection(&self, &Contig) -> Option + fn contig_intersection(&self, other: &Contig) -> Option where Self: ::std::marker::Sized, Self::RefID: PartialEq + Clone, diff --git a/src/annot/mod.rs b/src/annot/mod.rs index b96dd49..22a1f49 100644 --- a/src/annot/mod.rs +++ b/src/annot/mod.rs @@ -44,7 +44,7 @@ //! # fn main() { try_main().unwrap(); } //! ``` -use strand; +use crate::strand; pub mod contig; pub mod loc; diff --git a/src/annot/pos.rs b/src/annot/pos.rs index 1201785..e5bacbb 100644 --- a/src/annot/pos.rs +++ b/src/annot/pos.rs @@ -14,10 +14,10 @@ use std::str::FromStr; use regex::Regex; -use annot::contig::Contig; -use annot::loc::Loc; -use annot::*; -use strand::*; +use crate::annot::contig::Contig; +use crate::annot::loc::Loc; +use crate::annot::*; +use crate::strand::*; /// Position on a particular, named sequence (e.g. a chromosome). /// diff --git a/src/annot/spliced.rs b/src/annot/spliced.rs index e109755..e67fef8 100644 --- a/src/annot/spliced.rs +++ b/src/annot/spliced.rs @@ -15,11 +15,11 @@ use std::str::FromStr; use regex::Regex; -use annot::contig::Contig; -use annot::loc::Loc; -use annot::pos::Pos; -use annot::*; -use strand::*; +use crate::annot::contig::Contig; +use crate::annot::loc::Loc; +use crate::annot::pos::Pos; +use crate::annot::*; +use crate::strand::*; // The spliced location representation inherently cannot represent // "bad" splicing structures. Locations comprise a first exon length, diff --git a/src/strand.rs b/src/strand.rs index 6231f12..3e64f28 100644 --- a/src/strand.rs +++ b/src/strand.rs @@ -281,7 +281,7 @@ impl Display for NoStrand { pub trait Same { /// Indicate when two strands are the "same" -- two /// unknown/unspecified strands are the "same" but are not equal. - fn same(&self, &Self) -> bool; + fn same(&self, other: &Self) -> bool; } impl Same for Option diff --git a/src/variant.rs b/src/variant.rs index ed4c5c7..93d8312 100644 --- a/src/variant.rs +++ b/src/variant.rs @@ -1,5 +1,5 @@ -use genome; -use sequence::{Base, Sequence}; +use crate::genome; +use crate::sequence::{Base, Sequence}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize};