diff --git a/.travis.yml b/.travis.yml index bf5e9bd70..546144d21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,9 +28,9 @@ matrix: # Minimum Rust - env: SUITE=checkfast - rust: "1.31.0" + rust: "1.34.0" - env: SUITE=testfast - rust: "1.31.0" + rust: "1.34.0" # Build Docs - env: SUITE=travis-push-docs diff --git a/README.md b/README.md index e395680e1..8a1f4bd9e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ We currently only verify this crate against a recent version of Sentry hosted on [sentry.io](https://sentry.io/) but it should work with on-prem Sentry versions 8.20 and later. -Additionally, the lowest Rust version we target is _1.31.0_. +Additionally, the lowest Rust version we target is _1.34.0_. ## Resources diff --git a/integrations/sentry-actix/README.md b/integrations/sentry-actix/README.md index e5b56ee39..6f754fc0f 100644 --- a/integrations/sentry-actix/README.md +++ b/integrations/sentry-actix/README.md @@ -18,7 +18,7 @@ We currently only verify this crate against a recent version of Sentry hosted on [sentry.io](https://sentry.io/) but it should work with on-prem Sentry versions 8.20 and later. -Additionally, the lowest Rust version we target is _1.31.0_. +Additionally, the lowest Rust version we target is _1.34.0_. ## Resources diff --git a/src/transport.rs b/src/transport.rs index 6481e210e..ce7926f86 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -4,6 +4,9 @@ use std::sync::{Arc, Condvar, Mutex}; use std::thread::{self, JoinHandle}; use std::time::{Duration, SystemTime}; +#[cfg(feature = "with_curl_transport")] +use std::io::Cursor; + #[cfg(any(feature = "with_reqwest_transport", feature = "with_curl_transport"))] use httpdate::parse_http_date; @@ -377,7 +380,7 @@ implement_http_transport! { _ => {} } - let body = serde_json::to_vec(&event).unwrap(); + let mut body = Cursor::new(serde_json::to_vec(&event).unwrap()); let mut retry_after = None; let mut headers = curl::easy::List::new(); headers.append(&format!("X-Sentry-Auth: {}", dsn.to_auth(Some(&user_agent)))).unwrap(); @@ -385,8 +388,8 @@ implement_http_transport! { headers.append("Content-Type: application/json").unwrap(); handle.http_headers(headers).unwrap(); handle.upload(true).unwrap(); - handle.in_filesize(body.len() as u64).unwrap(); - handle.read_function(move |buf| Ok((&body[..]).read(buf).unwrap_or(0))).unwrap(); + handle.in_filesize(body.get_ref().len() as u64).unwrap(); + handle.read_function(move |buf| Ok(body.read(buf).unwrap_or(0))).unwrap(); handle.verbose(true).unwrap(); handle.debug_function(move |info, data| { let prefix = match info {