Skip to content

Commit

Permalink
update to 2018 edition (#24)
Browse files Browse the repository at this point in the history
* make serde optional

* update to 2018 edition

* try to cache

* fixes

* add lock

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
  • Loading branch information
pmarks and johanneskoester committed Jan 6, 2021
1 parent da5206f commit 8b71a8b
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 22 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
158 changes: 158 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions src/annot/contig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/annot/loc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,7 +80,7 @@ pub trait Loc {
Self::Strand: Into<ReqStrand> + Copy,
T: Neg<Output = T> + Copy;

fn contig_intersection<T>(&self, &Contig<Self::RefID, T>) -> Option<Self>
fn contig_intersection<T>(&self, other: &Contig<Self::RefID, T>) -> Option<Self>
where
Self: ::std::marker::Sized,
Self::RefID: PartialEq + Clone,
Expand Down
2 changes: 1 addition & 1 deletion src/annot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//! # fn main() { try_main().unwrap(); }
//! ```

use strand;
use crate::strand;

pub mod contig;
pub mod loc;
Expand Down
8 changes: 4 additions & 4 deletions src/annot/pos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
///
Expand Down
10 changes: 5 additions & 5 deletions src/annot/spliced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/strand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> Same for Option<T>
Expand Down
4 changes: 2 additions & 2 deletions src/variant.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down

0 comments on commit 8b71a8b

Please sign in to comment.