Skip to content

Commit

Permalink
fmt clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
levkk committed Jan 11, 2025
1 parent 3032d81 commit 15a4f4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
7 changes: 1 addition & 6 deletions examples/routing-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ pub extern "C" fn pgdog_route_query(input: Input) -> Output {
let id = parameter.as_str().map(|str| str.parse::<i64>());
match id {
Some(Ok(id)) => id,
_ => i64::from_be_bytes(
parameter
.as_bytes()
.try_into()
.unwrap_or([0u8; 8]),
),
_ => i64::from_be_bytes(parameter.as_bytes().try_into().unwrap_or([0u8; 8])),
}
})
});
Expand Down
3 changes: 1 addition & 2 deletions pgdog-plugin/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ impl<'a> Plugin<'a> {

/// Load standard methods from the plugin library.
pub fn load(name: &str, library: &'a Library) -> Self {
let route =
unsafe { library.get(b"pgdog_route_query\0") }.ok();
let route = unsafe { library.get(b"pgdog_route_query\0") }.ok();
let init = unsafe { library.get(b"pgdog_init\0") }.ok();
let fini = unsafe { library.get(b"pgdog_fini\0") }.ok();

Expand Down
6 changes: 3 additions & 3 deletions pgdog/src/backend/pool/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ impl Clone for Pool {
impl Pool {
/// Create new connection pool.
pub fn new(config: PoolConfig) -> Self {


Self {
inner: Arc::new(Mutex::new(Inner::new(config.config))),
comms: Arc::new(Comms::new()),
Expand All @@ -142,7 +140,9 @@ impl Pool {
return Err(Error::Offline);
}

let conn = guard.take(id).map(|server| Guard::new(self.clone(), server));
let conn = guard
.take(id)
.map(|server| Guard::new(self.clone(), server));

(
if guard.paused {
Expand Down

0 comments on commit 15a4f4d

Please sign in to comment.