From b69d55ce0bc8fe151da98cc51ac69fd9d36cf380 Mon Sep 17 00:00:00 2001 From: Florian Gilcher Date: Fri, 16 Aug 2019 23:37:13 +0200 Subject: [PATCH] Fix weird apostrophes --- docs/src/concepts/futures.md | 2 +- docs/src/concepts/tasks.md | 2 +- docs/src/security/policy.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/concepts/futures.md b/docs/src/concepts/futures.md index be04cfe9..0662d573 100644 --- a/docs/src/concepts/futures.md +++ b/docs/src/concepts/futures.md @@ -101,7 +101,7 @@ This function sets up a deferred computation. When this function is called, it w ## What does `.await` do? -The `.await` postfix does exactly what it says on the tin: the moment you use it, the code will wait until the requested action (e.g. opening a file or reading all data in it) is finished. `.await?` is not special, it’s just the application of the `?` operator to the result of `.await`. So, what is gained over the initial code example? We’re getting futures and then immediately waiting for them? +The `.await` postfix does exactly what it says on the tin: the moment you use it, the code will wait until the requested action (e.g. opening a file or reading all data in it) is finished. `.await?` is not special, it's just the application of the `?` operator to the result of `.await`. So, what is gained over the initial code example? We’re getting futures and then immediately waiting for them? The `.await` points act as a marker. Here, the code will wait for a `Future` to produce its value. How will a future finish? You don’t need to care! The marker allows the code later *executing* this piece of code (usually called the “runtime”) when it can take some time to care about all the other things it has to do. It will come back to this point when the operation you are doing in the background is done. This is why this style of programming is also called *evented programming*. We are waiting for *things to happen* (e.g. a file to be opened) and then react (by starting to read). diff --git a/docs/src/concepts/tasks.md b/docs/src/concepts/tasks.md index a4238ddc..18f960be 100644 --- a/docs/src/concepts/tasks.md +++ b/docs/src/concepts/tasks.md @@ -50,7 +50,7 @@ task::spawn(async { }) ``` -`spawn` takes a Future and starts running it on a `Task`. It returns a `JoinHandle`. Futures in Rust are sometimes called *cold* Futures. You need something that starts running them. To run a Future, there may be some additional bookkeeping required, e.g. if it’s running or finished, where it is being placed in memory and what the current state is. This bookkeeping part is abstracted away in a `Task`. A `Task` is similar to a `Thread`, with some minor differences: it will be scheduled by the program instead of the operating system kernel and if it encounters a point where it needs to wait, the program itself responsible for waking it up again. We’ll talk a little bit about that later. An `async_std` task can also has a name and an ID, just like a thread. +`spawn` takes a Future and starts running it on a `Task`. It returns a `JoinHandle`. Futures in Rust are sometimes called *cold* Futures. You need something that starts running them. To run a Future, there may be some additional bookkeeping required, e.g. if it's running or finished, where it is being placed in memory and what the current state is. This bookkeeping part is abstracted away in a `Task`. A `Task` is similar to a `Thread`, with some minor differences: it will be scheduled by the program instead of the operating system kernel and if it encounters a point where it needs to wait, the program itself responsible for waking it up again. We’ll talk a little bit about that later. An `async_std` task can also has a name and an ID, just like a thread. For now, it is enough to know that once you `spawn`ed a task, it will continue running in the background. The `JoinHandle` in itself is a future that will finish once the `Task` ran to conclusion. Much like with `threads` and the `join` function, we can now call `block_on` on the handle to *block* the program (or the calling thread, to be specific) to wait for it to finish. diff --git a/docs/src/security/policy.md b/docs/src/security/policy.md index 35d43c7c..990d8114 100644 --- a/docs/src/security/policy.md +++ b/docs/src/security/policy.md @@ -24,7 +24,7 @@ The async-std project has a 5 step disclosure process. * Fixes are prepared for all releases which are still under maintenance. These fixes are not committed to the public repository but rather held locally pending the announcement. * On the embargo date, the changes are pushed to the public repository and new builds are deployed to crates.io. Within 6 hours, a copy of the advisory will be published on the the async.rs blog. -This process can take some time, especially when coordination is required with maintainers of other projects. Every effort will be made to handle the bug in as timely a manner as possible, however it’s important that we follow the release process above to ensure that the disclosure is handled in a consistent manner. +This process can take some time, especially when coordination is required with maintainers of other projects. Every effort will be made to handle the bug in as timely a manner as possible, however it's important that we follow the release process above to ensure that the disclosure is handled in a consistent manner. ## Credits @@ -63,4 +63,4 @@ JJl4tktgD9T7Rb5uzRhHCSbLy89DQVvCcKD4B94ffuDW3HO8n8utDusOiZuG4BUf WdFy6/gTLNiFbTzkq1BBJQMN1nBwGs1sn63RRgjumZ1N =dIcF -----END PGP PUBLIC KEY BLOCK----- -``` \ No newline at end of file +```