Skip to content

Commit 9f2145e

Browse files
authored
Revert ".into -> Bytes::from" (#554)
This reverts commit fea841e.
1 parent fea841e commit 9f2145e

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

content/tokio/tutorial/hello-tokio.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub async fn main() -> Result<()> {
4040
let mut client = client::connect("127.0.0.1:6379").await?;
4141

4242
// Set the key "hello" with value "world"
43-
client.set("hello", bytes::Bytes::from("world")).await?;
43+
client.set("hello", "world".into()).await?;
4444

4545
// Get key "hello"
4646
let result = client.get("hello").await?;
@@ -139,8 +139,8 @@ pub async fn connect<T: ToSocketAddrs>(addr: T) -> Result<Client> {
139139

140140
The `async fn` definition looks like a regular synchronous function, but
141141
operates asynchronously. Rust transforms the `async fn` at **compile** time into
142-
a routine that operates asynchronously. Any calls to `.await` within the
143-
`async fn` yield control back to the thread. The thread may do other work while the
142+
a routine that operates asynchronously. Any calls to `.await` within the `async
143+
fn` yield control back to the thread. The thread may do other work while the
144144
operation processes in the background.
145145

146146
[[warning]]

tutorial-code/hello-tokio/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ publish = false
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
bytes = "1.0.1"
1211
tokio = { version = "1", features = ["full"] }
1312
mini-redis = "0.4"

tutorial-code/hello-tokio/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ async fn main() -> mini_redis::Result<()> {
66
let mut client = client::connect("127.0.0.1:6379").await?;
77

88
// Set the key "hello" with value "world"
9-
client.set("hello", bytes::Bytes::from("world")).await?;
9+
client.set("hello", "world".into()).await?;
1010

1111
// Get key "hello"
1212
let result = client.get("hello").await?;

0 commit comments

Comments
 (0)