Skip to content

Commit

Permalink
fix: update deps, make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Jun 29, 2023
1 parent cd43c4e commit ac1a316
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "alevin-fry"
version = "0.8.1"
version = "0.8.2"
authors = [
"Avi Srivastava <avi.srivastava@nyu.edu>",
"Hirak Sarkar <hirak_sarkar@hms.harvard.edu>",
Expand All @@ -16,7 +16,6 @@ repository = "https://github.com/COMBINE-lab/alevin-fry"
homepage = "https://github.com/COMBINE-lab/alevin-fry"
documentation = "https://alevin-fry.readthedocs.io/en/latest/"
include = [
"/libradicl/src/*.rs",
"/src/*.rs",
"/Cargo.toml",
"/README.md",
Expand Down
6 changes: 3 additions & 3 deletions src/collate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use serde_json::json;
use std::collections::HashMap;
use std::fs::File;
use std::io::BufReader;
use std::io::{BufWriter, Cursor, Read, Seek, SeekFrom, Write};
use std::io::{BufWriter, Cursor, Read, Seek, Write};
use std::iter::FromIterator;
use std::path::{Path, PathBuf};
use std::str::FromStr;
Expand Down Expand Up @@ -370,7 +370,7 @@ where
// the exact position at the end of the header,
// precisely sizeof(u64) bytes beyond the num_chunks field.
let end_header_pos =
br.get_ref().seek(SeekFrom::Current(0)).unwrap() - (br.buffer().len() as u64);
br.get_ref().stream_position().unwrap() - (br.buffer().len() as u64);

info!(
log,
Expand Down Expand Up @@ -398,7 +398,7 @@ where
let umit = rl_tags.tags[1].typeid;

// the exact position at the end of the header + file tags
let pos = br.get_ref().seek(SeekFrom::Current(0)).unwrap() - (br.buffer().len() as u64);
let pos = br.get_ref().stream_position().unwrap() - (br.buffer().len() as u64);

// copy the header
{
Expand Down
2 changes: 1 addition & 1 deletion src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ where

// keep a pointer to header pos
let end_header_pos =
data.seek(SeekFrom::Current(0)).unwrap() - std::mem::size_of::<u64>() as u64;
data.stream_position().unwrap() - std::mem::size_of::<u64>() as u64;

// check header position
info!(log, "end header pos: {:?}", end_header_pos,);
Expand Down
18 changes: 4 additions & 14 deletions src/quant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,13 @@ use libradicl::rad_types;

type BufferedGzFile = BufWriter<GzEncoder<fs::File>>;

#[derive(PartialEq, Eq, Debug, Clone, Copy, Serialize)]
#[derive(PartialEq, Eq, Debug, Default, Clone, Copy, Serialize)]
pub enum SplicedAmbiguityModel {
PreferAmbiguity,
#[default]
WinnerTakeAll,
}

impl Default for SplicedAmbiguityModel {
fn default() -> Self {
SplicedAmbiguityModel::WinnerTakeAll
}
}

// Implement the trait
impl FromStr for SplicedAmbiguityModel {
type Err = &'static str;
Expand All @@ -71,9 +66,10 @@ impl FromStr for SplicedAmbiguityModel {
}
}

#[derive(PartialEq, Eq, Debug, Clone, Copy, Serialize)]
#[derive(PartialEq, Eq, Debug, Default, Clone, Copy, Serialize)]
pub enum ResolutionStrategy {
Trivial,
#[default]
CellRangerLike,
CellRangerLikeEm,
ParsimonyEm,
Expand All @@ -82,12 +78,6 @@ pub enum ResolutionStrategy {
ParsimonyGene,
}

impl Default for ResolutionStrategy {
fn default() -> Self {
ResolutionStrategy::CellRangerLike
}
}

impl fmt::Display for ResolutionStrategy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
Expand Down

0 comments on commit ac1a316

Please sign in to comment.