mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
io: make with_input provide mut Read
Summary: Without `mut`, the `Read` cannot actually read anything. Reviewed By: yancouto Differential Revision: D31465817 fbshipit-source-id: b069499ff0e8a371f0e27402baedfb25414e29a1
This commit is contained in:
parent
0e8d76b982
commit
17fef63dbc
@ -197,8 +197,8 @@ impl IOProgress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl IO {
|
impl IO {
|
||||||
pub fn with_input<R>(&self, f: impl FnOnce(&dyn Read) -> R) -> R {
|
pub fn with_input<R>(&self, f: impl FnOnce(&mut dyn Read) -> R) -> R {
|
||||||
f(self.inner.lock().input.as_ref())
|
f(self.inner.lock().input.as_mut())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_output<R>(&self, f: impl FnOnce(&dyn Write) -> R) -> R {
|
pub fn with_output<R>(&self, f: impl FnOnce(&dyn Write) -> R) -> R {
|
||||||
|
Loading…
Reference in New Issue
Block a user