mirror of https://github.com/fafhrd91/actix-web
fix tests
This commit is contained in:
parent
2858e8534a
commit
83ff4f38e1
|
@ -74,7 +74,7 @@ async fn service(msg: ws::Frame) -> Result<ws::Message, Error> {
|
|||
let msg = match msg {
|
||||
ws::Frame::Ping(msg) => ws::Message::Pong(msg),
|
||||
ws::Frame::Text(text) => {
|
||||
ws::Message::Text(String::from_utf8_lossy(&text).to_owned().into())
|
||||
ws::Message::Text(String::from_utf8_lossy(&text).into_owned().into())
|
||||
}
|
||||
ws::Frame::Binary(bin) => ws::Message::Binary(bin),
|
||||
ws::Frame::Continuation(item) => ws::Message::Continuation(item),
|
||||
|
|
|
@ -39,7 +39,7 @@ async fn test_simple() {
|
|||
// client service
|
||||
let mut framed = srv.ws().await.unwrap();
|
||||
framed
|
||||
.send(ws::Message::Text("text".to_string()))
|
||||
.send(ws::Message::Text("text".into()))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
//! .await?;
|
||||
//!
|
||||
//! connection
|
||||
//! .send(awc::ws::Message::Text("Echo".to_string()))
|
||||
//! .send(awc::ws::Message::Text("Echo".into()))
|
||||
//! .await?;
|
||||
//! let response = connection.next().await.unwrap()?;
|
||||
//! # assert_eq!(response, awc::ws::Frame::Text("Echo".as_bytes().into()));
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
//! .unwrap();
|
||||
//!
|
||||
//! connection
|
||||
//! .send(ws::Message::Text("Echo".to_string()))
|
||||
//! .send(ws::Message::Text("Echo".into()))
|
||||
//! .await
|
||||
//! .unwrap();
|
||||
//! let response = connection.next().await.unwrap().unwrap();
|
||||
|
|
|
@ -11,7 +11,7 @@ async fn ws_service(req: ws::Frame) -> Result<ws::Message, io::Error> {
|
|||
match req {
|
||||
ws::Frame::Ping(msg) => Ok(ws::Message::Pong(msg)),
|
||||
ws::Frame::Text(text) => Ok(ws::Message::Text(
|
||||
String::from_utf8(Vec::from(text.as_ref())).unwrap(),
|
||||
String::from_utf8(Vec::from(text.as_ref())).unwrap().into(),
|
||||
)),
|
||||
ws::Frame::Binary(bin) => Ok(ws::Message::Binary(bin)),
|
||||
ws::Frame::Close(reason) => Ok(ws::Message::Close(reason)),
|
||||
|
@ -44,7 +44,7 @@ async fn test_simple() {
|
|||
// client service
|
||||
let mut framed = srv.ws().await.unwrap();
|
||||
framed
|
||||
.send(ws::Message::Text("text".to_string()))
|
||||
.send(ws::Message::Text("text".into()))
|
||||
.await
|
||||
.unwrap();
|
||||
let item = framed.next().await.unwrap().unwrap();
|
||||
|
|
Loading…
Reference in New Issue