Skip to content

Commit

Permalink
Make 'get_datacenters' function return sorted list of dcs
Browse files Browse the repository at this point in the history
  • Loading branch information
vponomaryov committed Aug 22, 2024
1 parent e0e0a0e commit e2bf054
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ impl Context {
/// Returns list of datacenters used by nodes
pub async fn get_datacenters(&self) -> Result<Vec<String>, CassError> {
let dc_info = self.session.get_cluster_data().get_datacenters_info();
return Ok(dc_info.keys().cloned().collect());
let mut datacenters: Vec<String> = dc_info.keys().cloned().collect();
datacenters.sort();
Ok(datacenters)
}

/// Prepares a statement and stores it in an internal statement map for future use.
Expand Down

0 comments on commit e2bf054

Please sign in to comment.