Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address new clippy warnings in Rust 1.83 #799

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ jobs:
distribution: 'temurin'
java-version: '11'
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@1.83
with:
toolchain: stable
override: true
components: clippy, rustfmt
- name: Check Formatting
run: cargo fmt -- --check
- uses: actions/setup-python@v5
Expand Down
4 changes: 2 additions & 2 deletions crates/arroyo-connectors/src/filesystem/sink/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ impl MultipartManager {
}
};
if self.all_uploads_finished() {
return FileCheckpointData::MultiPartWriterUploadCompleted {
FileCheckpointData::MultiPartWriterUploadCompleted {
multi_part_upload_id: multipart_id.clone(),
completed_parts: self
.pushed_parts
Expand All @@ -1250,7 +1250,7 @@ impl MultipartManager {
}
})
.collect(),
};
}
} else {
let in_flight_parts = self
.pushed_parts
Expand Down
2 changes: 1 addition & 1 deletion crates/arroyo-connectors/src/nexmark/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl GeneratorConfig {
(1_000_000_000.0 / (nexmark_config.first_event_rate)
* (nexmark_config.num_event_generators as f64)) as u64,
),
_step_length_second: (nexmark_config.rate_period_seconds + 2 - 1) / 2,
_step_length_second: nexmark_config.rate_period_seconds.div_ceil(2),
base_time,
first_event_id,
max_events: nexmark_config.get_max_events(max_events),
Expand Down
2 changes: 1 addition & 1 deletion crates/arroyo-controller/src/states/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ pub struct JobContext<'a> {
metrics: Arc<tokio::sync::RwLock<HashMap<Arc<String>, JobMetrics>>>,
}

impl<'a> JobContext<'a> {
impl JobContext<'_> {
pub fn handle(&mut self, msg: JobMessage) -> Result<(), StateError> {
if !matches!(
msg,
Expand Down
4 changes: 2 additions & 2 deletions crates/arroyo-planner/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl ExtensionPlanner for ArroyoExtensionPlanner {
}
}

impl<'a> PlanToGraphVisitor<'a> {
impl PlanToGraphVisitor<'_> {
fn add_index_to_traversal(&mut self, index: NodeIndex) {
if let Some(last) = self.traversal.last_mut() {
last.push(index);
Expand Down Expand Up @@ -327,7 +327,7 @@ impl<'a> PlanToGraphVisitor<'a> {
}
}

impl<'a> TreeNodeVisitor<'_> for PlanToGraphVisitor<'a> {
impl TreeNodeVisitor<'_> for PlanToGraphVisitor<'_> {
type Node = LogicalPlan;

fn f_down(&mut self, node: &Self::Node) -> Result<TreeNodeRecursion> {
Expand Down
4 changes: 2 additions & 2 deletions crates/arroyo-planner/src/plan/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct AggregateRewriter<'a> {
pub schema_provider: &'a ArroyoSchemaProvider,
}

impl<'a> AggregateRewriter<'a> {
impl AggregateRewriter<'_> {
pub fn rewrite_non_windowed_aggregate(
input: Arc<LogicalPlan>,
mut key_fields: Vec<DFField>,
Expand Down Expand Up @@ -119,7 +119,7 @@ impl<'a> AggregateRewriter<'a> {
}
}

impl<'a> TreeNodeRewriter for AggregateRewriter<'a> {
impl TreeNodeRewriter for AggregateRewriter<'_> {
type Node = LogicalPlan;

fn f_up(&mut self, node: Self::Node) -> Result<Transformed<Self::Node>> {
Expand Down
4 changes: 2 additions & 2 deletions crates/arroyo-planner/src/plan/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) struct JoinRewriter<'a> {
pub schema_provider: &'a ArroyoSchemaProvider,
}

impl<'a> JoinRewriter<'a> {
impl JoinRewriter<'_> {
fn check_join_windowing(join: &Join) -> Result<bool> {
let left_window = WindowDetectingVisitor::get_window(&join.left)?;
let right_window = WindowDetectingVisitor::get_window(&join.right)?;
Expand Down Expand Up @@ -189,7 +189,7 @@ impl<'a> JoinRewriter<'a> {
}
}

impl<'a> TreeNodeRewriter for JoinRewriter<'a> {
impl TreeNodeRewriter for JoinRewriter<'_> {
type Node = LogicalPlan;

fn f_up(&mut self, node: Self::Node) -> Result<Transformed<Self::Node>> {
Expand Down
2 changes: 1 addition & 1 deletion crates/arroyo-planner/src/plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub struct ArroyoRewriter<'a> {
pub(crate) schema_provider: &'a ArroyoSchemaProvider,
}

impl<'a> TreeNodeRewriter for ArroyoRewriter<'a> {
impl TreeNodeRewriter for ArroyoRewriter<'_> {
type Node = LogicalPlan;

fn f_up(&mut self, mut node: Self::Node) -> Result<Transformed<Self::Node>> {
Expand Down
10 changes: 5 additions & 5 deletions crates/arroyo-planner/src/rewriters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct SourceRewriter<'a> {
pub(crate) schema_provider: &'a ArroyoSchemaProvider,
}

impl<'a> SourceRewriter<'a> {
impl SourceRewriter<'_> {
fn watermark_expression(table: &ConnectorTable) -> DFResult<Expr> {
let expr = match table.watermark_field.clone() {
Some(watermark_field) => table
Expand Down Expand Up @@ -253,7 +253,7 @@ impl<'a> SourceRewriter<'a> {
}
}

impl<'a> TreeNodeRewriter for SourceRewriter<'a> {
impl TreeNodeRewriter for SourceRewriter<'_> {
type Node = LogicalPlan;

fn f_up(&mut self, node: Self::Node) -> DFResult<Transformed<Self::Node>> {
Expand Down Expand Up @@ -502,7 +502,7 @@ impl<'a> AsyncUdfRewriter<'a> {
}
}

impl<'a> TreeNodeRewriter for AsyncUdfRewriter<'a> {
impl TreeNodeRewriter for AsyncUdfRewriter<'_> {
type Node = LogicalPlan;

fn f_up(&mut self, node: Self::Node) -> DFResult<Transformed<Self::Node>> {
Expand Down Expand Up @@ -588,7 +588,7 @@ impl<'a> SourceMetadataVisitor<'a> {
}
}

impl<'a> SourceMetadataVisitor<'a> {
impl SourceMetadataVisitor<'_> {
fn get_connection_id(&self, node: &LogicalPlan) -> Option<i64> {
let LogicalPlan::Extension(Extension { node }) = node else {
return None;
Expand All @@ -614,7 +614,7 @@ impl<'a> SourceMetadataVisitor<'a> {
}
}

impl<'a> TreeNodeVisitor<'_> for SourceMetadataVisitor<'a> {
impl TreeNodeVisitor<'_> for SourceMetadataVisitor<'_> {
type Node = LogicalPlan;

fn f_down(&mut self, node: &Self::Node) -> DFResult<TreeNodeRecursion> {
Expand Down
2 changes: 1 addition & 1 deletion crates/arroyo-rpc/src/var_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Serialize for VarStr {

struct VarStrVisitor;

impl<'de> Visitor<'de> for VarStrVisitor {
impl Visitor<'_> for VarStrVisitor {
type Value = VarStr;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
1 change: 1 addition & 0 deletions crates/arroyo-state/src/tables/global_keyed_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub struct GlobalKeyedTable {
}

impl GlobalKeyedTable {
#[allow(clippy::type_complexity)]
fn get_key_value_iterator<'a>(
&self,
record_batch: &'a RecordBatch,
Expand Down
2 changes: 1 addition & 1 deletion crates/arroyo-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ pub struct CheckpointBarrier {

pub struct DisplayAsSql<'a>(pub &'a DataType);

impl<'a> Display for DisplayAsSql<'a> {
impl Display for DisplayAsSql<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self.0 {
DataType::Boolean => write!(f, "BOOLEAN"),
Expand Down
Loading