Skip to content

Commit

Permalink
Clippy + rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SevInf committed Oct 16, 2024
1 parent 60974c0 commit a57fc56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion quaint/src/connector/postgres/native/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) async fn connect_via_websocket(url: PostgresWebSocketUrl) -> crate::R

let mut config = Config::from_str(connection_params)?;
if let Some(db_name) = db_name {
config.dbname(&db_name);
config.dbname(&db_name);
}
let ws_byte_stream = WsStream::new(ws_stream);

Expand Down
8 changes: 6 additions & 2 deletions quaint/src/connector/postgres/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,11 @@ pub struct PostgresWebSocketUrl {

impl PostgresWebSocketUrl {
pub fn new(url: Url, api_key: String) -> Self {
Self { url, api_key, db_name: None }
Self {
url,
api_key,
db_name: None,
}
}

pub fn override_db_name(&mut self, name: String) {
Expand All @@ -514,7 +518,7 @@ impl PostgresWebSocketUrl {
}

pub fn overriden_db_name(&self) -> Option<&str> {
self.db_name.as_ref().map(|s| s.as_str())
self.db_name.as_deref()
}

pub fn host(&self) -> &str {
Expand Down

0 comments on commit a57fc56

Please sign in to comment.