Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
applied grammar changes

Co-authored-by: Ali Khorami <[email protected]>
  • Loading branch information
Emilorzz and sabotack authored Dec 15, 2023
1 parent dba66c7 commit bd900ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/data_reader/component_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl JsonProjectLoader {
component.populate_usages_with_invariants();

// Remove the redundant clocks from component using the clock_usages
// TODO Maybe log removed clocks
// TODO: Maybe log removed clocks
match component.remove_redundant_clocks() {
Ok(()) => {}
Err(err) => {
Expand Down
16 changes: 8 additions & 8 deletions src/model_objects/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use std::iter::FromIterator;
pub enum ClockReduceError {
/// Takes a clock name
ClockIndexNotFound(String),
/// missing clockIndices without a specific clock in mind
/// Missing clockIndices without a specific clock in mind
NoClockIndices,
/// Used for evaluating the expressions in clock_usages
EvaluationError(String),
/// For all errors relating to clockReduction but does not fit in the others
/// For all errors relating to clockReduction that do not fit in the others
Other(String),
}
impl std::fmt::Display for ClockReduceError {
Expand Down Expand Up @@ -61,7 +61,7 @@ pub struct Component {
pub clock_usages: HashMap<String, ClockUsage>,
}

///Details to what edges and locations, clocks are used and where there are updates
/// Details to what edges and locations, clocks are used and where there are updates
#[derive(Debug, Default, Deserialize, Clone, Eq, PartialEq)]
pub struct ClockUsage {
pub edges: HashSet<String>,
Expand All @@ -70,7 +70,7 @@ pub struct ClockUsage {
}

impl ClockUsage {
//edge_id is generated in function remake_edge_ids
// edge_id is generated in function remake_edge_ids
pub fn is_in_edge(&self, edge_id: &str) -> bool {
self.edges.contains(edge_id) || self.updates.contains(edge_id)
}
Expand Down Expand Up @@ -234,13 +234,13 @@ impl Component {
for edge in &self.edges {
// Find the clocks affected by this edge
let local_equivalences = self.find_local_equivalences(edge)?;
// Update the global clocks variable with the new information and splits the groups
// Update the global clocks variable with the new information and split the groups
self.update_equivalent_clock_groups(&mut equivalent_clock_groups, &local_equivalences);
}
Ok(equivalent_clock_groups)
}

// Find the clocks which diverges from their respective clock groups on a edge/transition
// Find the clocks that diverge from their respective clock groups on a edge/transition
fn find_local_equivalences(
&self,
edge: &Edge,
Expand Down Expand Up @@ -464,7 +464,7 @@ mod tests {
expected: HashSet<String>,
}

///Simplifying the test process by loading a component in a separate function, instead of in each test
/// Simplifying the test process by loading a component in a separate function, instead of in each test
fn setup(comp_name: &str, expected: Vec<String>) -> SetupContext {
let mut project_loader = JsonProjectLoader::new_loader(PATH, crate::tests::TEST_SETTINGS);
project_loader.get_settings_mut().disable_clock_reduction = true;
Expand Down Expand Up @@ -608,7 +608,7 @@ mod tests {
let mut used_clocks: HashSet<String> = test_comp.clock_usages.keys().cloned().collect();
let unused_clocks: HashSet<String> = test_comp.get_unused_clocks(&test_comp.clock_usages);

// Remove the clocks(and their updates) which never gets read from
// Remove the clocks(and their updates) which never get read from
for unused_clocks in &unused_clocks {
used_clocks.remove(unused_clocks);
test_comp.declarations.remove_clock_from_dcls(unused_clocks);
Expand Down

0 comments on commit bd900ba

Please sign in to comment.