Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Dec 29, 2023
1 parent 50cb230 commit 510bd8b
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 21 deletions.
13 changes: 3 additions & 10 deletions src/cursor/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ fn breadcrumbs_to_data(crumbs: &Breadcrumbs) -> Vec<(u64, String)> {
crumbs
.points()
.into_iter()
.map(|p| match p {
.filter_map(|p| match p {
Point::Origin => None,
Point::Specific(slot, hash) => Some((slot, hex::encode(hash))),
})
.flatten()
.collect()
}

Expand Down Expand Up @@ -124,10 +123,7 @@ impl Config {
pub fn initial_load(&self) -> Result<Breadcrumbs, Error> {
let path = self.define_path()?;

let max_breadcrumbs = self
.max_breadcrumbs
.clone()
.unwrap_or(DEFAULT_MAX_BREADCRUMBS);
let max_breadcrumbs = self.max_breadcrumbs.unwrap_or(DEFAULT_MAX_BREADCRUMBS);

if path.is_file() {
let file = std::fs::File::open(&path).map_err(|err| Error::Custom(err.to_string()))?;
Expand All @@ -141,10 +137,7 @@ impl Config {
}

pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
let flush_interval = self
.flush_interval
.clone()
.unwrap_or(DEFAULT_FLUSH_INTERVAL as u64);
let flush_interval = self.flush_interval.unwrap_or(DEFAULT_FLUSH_INTERVAL as u64);

let stage = Stage {
path: self.define_path()?,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_sqs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/gcp_cloudfunction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/gcp_pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/rabbitmq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub struct Config {
}

impl Config {
pub fn bootstrapper(self, ctx: &Context) -> Result<Stage, Error> {
pub fn bootstrapper(self, _ctx: &Context) -> Result<Stage, Error> {
let stage = Stage {
config: self,
ops_count: Default::default(),
Expand Down
3 changes: 1 addition & 2 deletions src/sources/utxorpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ impl gasket::framework::Worker<Stage> for Worker {

let intersect = intersect
.into_iter()
.map(point_to_blockref)
.flatten()
.filter_map(point_to_blockref)
.collect::<Vec<_>>()
.pop();

Expand Down

0 comments on commit 510bd8b

Please sign in to comment.