mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Fix Query type docs
`give` no longer exists, `compute` is used to generate query results now.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
use syntax::{self, ast};
|
||||
|
||||
/// Represent the result of a query.
|
||||
/// This result can be stolen with the `take` method and returned with the `give` method.
|
||||
/// This result can be stolen with the `take` method and generated with the `compute` method.
|
||||
pub struct Query<T> {
|
||||
result: RefCell<Option<Result<T>>>,
|
||||
}
|
||||
@@ -37,7 +37,7 @@ fn compute<F: FnOnce() -> Result<T>>(&self, f: F) -> Result<&Query<T>> {
|
||||
}
|
||||
|
||||
/// Takes ownership of the query result. Further attempts to take or peek the query
|
||||
/// result will panic unless it is returned by calling the `give` method.
|
||||
/// result will panic unless it is generated by calling the `compute` method.
|
||||
pub fn take(&self) -> T {
|
||||
self.result
|
||||
.borrow_mut()
|
||||
|
||||
Reference in New Issue
Block a user