Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
andicuko committed May 24, 2024
1 parent d526ee7 commit 3e5ebe1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/privacy_unit_tracking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ impl Relation {
.collect();
Relation::map()
.with_iter(left.into_iter().filter_map(|(o, i)| {
lookup_fields_to_names.get(i.name())
lookup_fields_to_names
.get(i.name())
.and_then(|name| Some((name.clone(), Expr::col(o.name()))))
}))
.with_iter(right.into_iter().filter_map(|(o, i)| {
Expand Down
18 changes: 10 additions & 8 deletions src/privacy_unit_tracking/privacy_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ impl Display for ReferredFields {
self.referred_id.clone()
),
"→".yellow(),
self.referred_fields.iter().zip(self.referred_fields_name.iter())
.map(|(a, b)| format!("{} AS {}", a, b))
.collect::<Vec<_>>()
.join(", ")
self.referred_fields
.iter()
.zip(self.referred_fields_name.iter())
.map(|(a, b)| format!("{} AS {}", a, b))
.collect::<Vec<_>>()
.join(", ")
)
}
}
Expand Down Expand Up @@ -261,7 +263,7 @@ impl<'a> IntoIterator for PrivacyUnitPath {
if let Some(last_step) = &mut last_step {
let mut referred_fields = vec![step.referring_id.to_string()];
let mut referred_fields_name = vec![PrivacyUnitPath::privacy_unit().to_string()];

if pu_referred_weight.is_some() {
referred_fields.push(step.referring_id.to_string());
referred_fields_name.push(PrivacyUnitPath::privacy_unit_weight().to_string())
Expand All @@ -285,7 +287,7 @@ impl<'a> IntoIterator for PrivacyUnitPath {
if let Some(last_step) = last_step {
let mut referred_fields = vec![self.privacy_unit_field];
let mut referred_fields_name = vec![PrivacyUnitPath::privacy_unit().to_string()];

if let Some(name) = pu_referred_weight {
referred_fields.push(name);
referred_fields_name.push(PrivacyUnitPath::privacy_unit_weight().to_string())
Expand Down Expand Up @@ -521,14 +523,14 @@ mod tests {
("order_id", "order_table", "id"),
("user_id", "user_table", "id"),
],
"name", "weight_col"
"name",
"weight_col",
)
.into();

let mut it = field_path.into_iter();
println!("{}", it.next().unwrap());
println!("{}", it.next().unwrap());

}

#[test]
Expand Down

0 comments on commit 3e5ebe1

Please sign in to comment.