Skip to content

Commit

Permalink
chore: Change MessageOptions::limit type to u8
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Oct 4, 2023
1 parent f19868b commit 5705112
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extensions/warp-ipfs/src/store/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl ConversationDocument {

let ipfs = ipfs.clone();
let stream = async_stream::stream! {
let mut remaining: Option<i64> = option.limit();
let mut remaining = option.limit();
for (index, document) in messages.iter().enumerate() {
if remaining.as_ref().map(|x| *x == 0).unwrap_or_default() {
break;
Expand Down
6 changes: 3 additions & 3 deletions warp/src/raygun/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub struct MessageOptions {
keyword: Option<String>,
pinned: bool,
range: Option<Range<usize>>,
limit: Option<i64>,
limit: Option<u8>,
skip: Option<i64>,
}

Expand All @@ -205,7 +205,7 @@ impl MessageOptions {
self
}

pub fn set_limit(mut self, limit: i64) -> MessageOptions {
pub fn set_limit(mut self, limit: u8) -> MessageOptions {
self.limit = Some(limit);
self.range = None;
self
Expand Down Expand Up @@ -255,7 +255,7 @@ impl MessageOptions {
}

impl MessageOptions {
pub fn limit(&self) -> Option<i64> {
pub fn limit(&self) -> Option<u8> {
self.limit
}

Expand Down

0 comments on commit 5705112

Please sign in to comment.