Skip to content

Commit

Permalink
Remove unnecessary references
Browse files Browse the repository at this point in the history
  • Loading branch information
pbzweihander committed Aug 13, 2023
1 parent eb9d679 commit e280fce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,14 @@ impl PGMQueue {
pub async fn read<T: for<'de> Deserialize<'de>>(
&self,
queue_name: &str,
vt: Option<&i32>,
vt: Option<i32>,
) -> Result<Option<Message<T>>, errors::PgmqError> {
// map vt or default VT
let vt_ = match vt {
Some(t) => t,
None => &VT_DEFAULT,
None => VT_DEFAULT,
};
let limit = &READ_LIMIT_DEFAULT;
let limit = READ_LIMIT_DEFAULT;
let query = &query::read(queue_name, vt_, limit)?;
let message = fetch_one_message::<T>(query, &self.connection).await?;
Ok(message)
Expand Down Expand Up @@ -614,13 +614,13 @@ impl PGMQueue {
pub async fn read_batch<T: for<'de> Deserialize<'de>>(
&self,
queue_name: &str,
vt: Option<&i32>,
num_msgs: &i32,
vt: Option<i32>,
num_msgs: i32,
) -> Result<Option<Vec<Message<T>>>, errors::PgmqError> {
// map vt or default VT
let vt_ = match vt {
Some(t) => t,
None => &VT_DEFAULT,
None => VT_DEFAULT,
};
let query = &query::read(queue_name, vt_, num_msgs)?;
let messages = fetch_messages::<T>(query, &self.connection).await?;
Expand Down
2 changes: 1 addition & 1 deletion core/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub fn enqueue(
))
}

pub fn read(name: &str, vt: &i32, limit: &i32) -> Result<String, PgmqError> {
pub fn read(name: &str, vt: i32, limit: i32) -> Result<String, PgmqError> {
check_input(name)?;
Ok(format!(
"
Expand Down

0 comments on commit e280fce

Please sign in to comment.