Update tungstenite and toml libs

update-deps
Ondřej Hruška 6 days ago
parent 9fb6bd4083
commit 79ce4ce378
  1. 5
      CHANGELOG.md
  2. 5
      Cargo.toml
  3. 2
      src/entities/status.rs
  4. 8
      src/helpers/toml.rs
  5. 5
      src/streaming.rs

@ -1,3 +1,8 @@
## Unreleased - fixes in fork
- Update dependencies
- Code cleanup and fixes to work with Pleroma
<a name="v0.18.0"></a>
## v0.18.0 (2019-01-05)

@ -21,8 +21,8 @@ serde_json = "1"
serde_urlencoded = "0.7.1"
serde_qs = "0.15.0"
url = "2.5.4"
toml = "0.5"
tokio-tungstenite = "0.16"
toml = { version="0.8", features = ["parse"] }
tokio-tungstenite = "0.27"
tokio = {version = "1", features = [ "fs" ] }
tokio-util = { version = "0.7", features = [ "io" ] }
tokio-stream = "0.1.17"
@ -33,4 +33,3 @@ futures-util = "0.3.31"
[dev-dependencies]
tempfile = "3.20.0"
indoc = "2.0.6"
pretty_env_logger = "0.5.0"

File diff suppressed because one or more lines are too long

@ -1,8 +1,8 @@
use crate::data::AppData;
use crate::Result;
use std::io::{Read, Write, BufWriter};
use std::path::Path;
use std::fs::{File, OpenOptions};
use std::io::{BufWriter, Read, Write};
use std::path::Path;
/// Attempts to deserialize a Data struct from a string
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
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
@ -36,7 +36,7 @@ pub fn to_string(data: &AppData) -> Result<String> {
/// Attempts to serialize a Data struct to a Vec of bytes
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

@ -92,7 +92,7 @@ impl EventReader {
pub async fn send_ping(&mut self) -> std::result::Result<(), tokio_tungstenite::tungstenite::Error> {
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::Ready(Some(Ok(Message::Frame(_)))) => {
unreachable!();
}
}
}
}

Loading…
Cancel
Save