Skip to content

Commit

Permalink
style: rustfmt normalize comments (hydro-project#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed May 21, 2023
1 parent cd0a86d commit 4d4446c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 19 deletions.
4 changes: 2 additions & 2 deletions hydroflow/examples/three_clique/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use clap::{Parser, ValueEnum};
use hydroflow::hydroflow_syntax;

//This example detects size three cliques in a graph. Size three cliques are also known as triangles.
//The equivalent datalog program would be Triangle(x,y,z) := Edge(x,y), Edge(y,z), Edge(z,x)
// This example detects size three cliques in a graph. Size three cliques are also known as triangles.
// The equivalent datalog program would be Triangle(x,y,z) := Edge(x,y), Edge(y,z), Edge(z,x)
#[derive(Parser, Debug, Clone, ValueEnum)]
enum GraphType {
Mermaid,
Expand Down
4 changes: 1 addition & 3 deletions hydroflow/src/scheduled/handoff/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ pub trait CanReceive<T> {
fn give(&self, item: T) -> T;
}

/**
* A handle onto the metadata part of a [Handoff], with no element type.
*/
/// A handle onto the metadata part of a [Handoff], with no element type.
pub trait HandoffMeta: Any {
fn any_ref(&self) -> &dyn Any;

Expand Down
4 changes: 1 addition & 3 deletions hydroflow/src/scheduled/handoff/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use std::rc::Rc;

use super::{CanReceive, Handoff, HandoffMeta, Iter};

/**
* A [Vec]-based FIFO handoff.
*/
/// A [Vec]-based FIFO handoff.
pub struct VecHandoff<T>
where
T: 'static,
Expand Down
10 changes: 4 additions & 6 deletions hydroflow/src/scheduled/reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ use tokio::sync::mpsc::UnboundedSender;

use super::SubgraphId;

/**
* A handle into a specific [super::graph::Hydroflow] instance for triggering
* subgraphs to run, possibly from another thread.
*
* Reactor events are considered to be external events.
*/
/// A handle into a specific [super::graph::Hydroflow] instance for triggering
/// subgraphs to run, possibly from another thread.
///
/// Reactor events are considered to be external events.
#[derive(Clone)]
pub struct Reactor {
event_queue_send: UnboundedSender<(SubgraphId, bool)>,
Expand Down
4 changes: 1 addition & 3 deletions hydroflow/src/scheduled/subgraph.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use super::context::Context;
use super::graph::HandoffData;

/**
* Represents a compiled subgraph. Used internally by [Dataflow] to erase the input/output [Handoff] types.
*/
/// Represents a compiled subgraph. Used internally by [Dataflow] to erase the input/output [Handoff] types.
pub(crate) trait Subgraph {
// TODO: pass in some scheduling info?
fn run(&mut self, context: &mut Context, handoffs: &mut Vec<HandoffData>);
Expand Down
4 changes: 2 additions & 2 deletions hydroflow_lang/src/graph/hydroflow_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl HydroflowGraph {
let Some(op_constraints) = find_op_op_constraints(operator) else { break 'oc None; };
let (input_port, output_port) = self.ports.get(edge_id).cloned().unwrap();
let generics = get_operator_generics(
&mut Vec::new(), /* TODO(mingwei) diagnostics */
&mut Vec::new(), // TODO(mingwei) diagnostics
operator,
);
Some(OperatorInstance {
Expand Down Expand Up @@ -1099,7 +1099,7 @@ impl HydroflowGraph {

// Write out external handoffs (handoffs between different subgraphs).
// This is set up in an awkward way in order to preserve the old write order.
//write out handoffs outside the clusters and adjacent edges
// write out handoffs outside the clusters and adjacent edges
for (src_id, src_node) in self.nodes() {
for (edge_id, dst_id) in self.node_successors(src_id) {
if barrier_handoffs.contains(&src_id) {
Expand Down
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ group_imports = "StdExternalCrate"
hex_literal_case = "Lower"
imports_granularity = "Module"
newline_style = "Unix"
normalize_comments = true
normalize_doc_attributes = true
use_field_init_shorthand = true
use_try_shorthand = true

0 comments on commit 4d4446c

Please sign in to comment.