Skip to content

Commit

Permalink
fix rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayko001 committed Feb 8, 2024
1 parent 62b9421 commit 3144cc1
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,24 @@ impl OrbFdw {
};

match obj {
"customers" => format!("{}/customers?limit={}{}", base_url, Self::PAGE_SIZE, cursor_param),
"subscriptions" => format!("{}/subscriptions?limit={}{}", base_url, Self::PAGE_SIZE, cursor_param),
"invoices" => format!("{}/invoices?limit={}{}", base_url, Self::PAGE_SIZE, cursor_param),
"customers" => format!(
"{}/customers?limit={}{}",
base_url,
Self::PAGE_SIZE,
cursor_param
),
"subscriptions" => format!(
"{}/subscriptions?limit={}{}",
base_url,
Self::PAGE_SIZE,
cursor_param
),
"invoices" => format!(
"{}/invoices?limit={}{}",
base_url,
Self::PAGE_SIZE,
cursor_param
),
_ => {
warning!("unsupported object: {:#?}", obj);
"".to_string()
Expand Down Expand Up @@ -268,15 +283,18 @@ impl ForeignDataWrapper for OrbFdw {
break;
}
result.append(&mut rows.clone());
cursor = json.get("pagination_metadata").and_then(|pm| pm.get("next_cursor")).and_then(|nc| nc.as_str()).map(String::from);
cursor = json
.get("pagination_metadata")
.and_then(|pm| pm.get("next_cursor"))
.and_then(|nc| nc.as_str())
.map(String::from);
// Break if there is no next cursor
if cursor.is_none() {
break;
}
}
self.scan_result = Some(result);
}

}

fn iter_scan(&mut self, row: &mut Row) -> Option<()> {
Expand Down

0 comments on commit 3144cc1

Please sign in to comment.