Update tungstenite and toml libs

This commit is contained in:
2025-06-15 16:23:14 +02:00
parent 9fb6bd4083
commit 79ce4ce378
5 changed files with 16 additions and 9 deletions
+5
View File
@@ -1,3 +1,8 @@
## Unreleased - fixes in fork
- Update dependencies
- Code cleanup and fixes to work with Pleroma
<a name="v0.18.0"></a> <a name="v0.18.0"></a>
## v0.18.0 (2019-01-05) ## v0.18.0 (2019-01-05)
+2 -3
View File
@@ -21,8 +21,8 @@ serde_json = "1"
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
serde_qs = "0.15.0" serde_qs = "0.15.0"
url = "2.5.4" url = "2.5.4"
toml = "0.5" toml = { version="0.8", features = ["parse"] }
tokio-tungstenite = "0.16" tokio-tungstenite = "0.27"
tokio = {version = "1", features = [ "fs" ] } tokio = {version = "1", features = [ "fs" ] }
tokio-util = { version = "0.7", features = [ "io" ] } tokio-util = { version = "0.7", features = [ "io" ] }
tokio-stream = "0.1.17" tokio-stream = "0.1.17"
@@ -33,4 +33,3 @@ futures-util = "0.3.31"
[dev-dependencies] [dev-dependencies]
tempfile = "3.20.0" tempfile = "3.20.0"
indoc = "2.0.6" indoc = "2.0.6"
pretty_env_logger = "0.5.0"
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -1,8 +1,8 @@
use crate::data::AppData; use crate::data::AppData;
use crate::Result; use crate::Result;
use std::io::{Read, Write, BufWriter};
use std::path::Path;
use std::fs::{File, OpenOptions}; use std::fs::{File, OpenOptions};
use std::io::{BufWriter, Read, Write};
use std::path::Path;
/// Attempts to deserialize a Data struct from a string /// Attempts to deserialize a Data struct from a string
pub fn from_str(s: &str) -> Result<AppData> { pub fn from_str(s: &str) -> Result<AppData> {
@@ -11,7 +11,7 @@ pub fn from_str(s: &str) -> Result<AppData> {
/// Attempts to deserialize a Data struct from a slice of bytes /// Attempts to deserialize a Data struct from a slice of bytes
pub fn from_slice(s: &[u8]) -> Result<AppData> { pub fn from_slice(s: &[u8]) -> Result<AppData> {
Ok(toml::from_slice(s)?) Ok(from_str(&String::from_utf8_lossy(s))?)
} }
/// Attempts to deserialize a Data struct from something that implements /// Attempts to deserialize a Data struct from something that implements
@@ -36,7 +36,7 @@ pub fn to_string(data: &AppData) -> Result<String> {
/// Attempts to serialize a Data struct to a Vec of bytes /// Attempts to serialize a Data struct to a Vec of bytes
pub fn to_vec(data: &AppData) -> Result<Vec<u8>> { pub fn to_vec(data: &AppData) -> Result<Vec<u8>> {
Ok(toml::to_vec(data)?) Ok(toml::to_string(data)?.as_bytes().to_vec())
} }
/// Attempts to serialize a Data struct to something that implements the /// Attempts to serialize a Data struct to something that implements the
+4 -1
View File
@@ -92,7 +92,7 @@ impl EventReader {
pub async fn send_ping(&mut self) -> std::result::Result<(), tokio_tungstenite::tungstenite::Error> { pub async fn send_ping(&mut self) -> std::result::Result<(), tokio_tungstenite::tungstenite::Error> {
trace!("Sending ping"); trace!("Sending ping");
self.stream.send(Message::Ping("pleroma groups".as_bytes().to_vec())).await self.stream.send(Message::Ping("pleroma groups".as_bytes().into())).await
} }
} }
@@ -146,6 +146,9 @@ impl Stream for EventReader {
Poll::Pending => { Poll::Pending => {
Poll::Pending Poll::Pending
} }
Poll::Ready(Some(Ok(Message::Frame(_)))) => {
unreachable!();
}
} }
} }
} }