mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-05-12 13:09:29 +00:00
Clean up warnings
This commit is contained in:
parent
3fdddfb233
commit
61129d30c0
@ -28,10 +28,10 @@ impl Client {
|
|||||||
|
|
||||||
for data in messages {
|
for data in messages {
|
||||||
let res = self.handle_payload(&data).unwrap();
|
let res = self.handle_payload(&data).unwrap();
|
||||||
if let Some(cb) = &self.on_content {
|
if let Some(cb) = &self.on_content
|
||||||
if let Some(content_data) = res {
|
&& let Some(content_data) = res
|
||||||
cb(content_data);
|
{
|
||||||
}
|
cb(content_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,11 +62,11 @@ impl DerefMut for Client {
|
|||||||
// Higher order function to handle printing
|
// Higher order function to handle printing
|
||||||
fn pretty_print(prefix: impl Into<String>) -> Box<dyn Fn(ContentData)> {
|
fn pretty_print(prefix: impl Into<String>) -> Box<dyn Fn(ContentData)> {
|
||||||
let prefix = prefix.into();
|
let prefix = prefix.into();
|
||||||
return Box::new(move |c: ContentData| {
|
Box::new(move |c: ContentData| {
|
||||||
let cid = hex_trunc(c.conversation_id.as_bytes());
|
let cid = hex_trunc(c.conversation_id.as_bytes());
|
||||||
let content = String::from_utf8(c.data).unwrap();
|
let content = String::from_utf8(c.data).unwrap();
|
||||||
println!("{} ({:?}) {}", prefix, cid, content)
|
println!("{} ({:?}) {}", prefix, cid, content)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process(clients: &mut Vec<Client>) {
|
fn process(clients: &mut Vec<Client>) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user