mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Migrate to Result<T, io::Error> -> io::Result<T>
This commit is contained in:
parent
d8ca817456
commit
fc460b1e42
1 changed files with 3 additions and 3 deletions
|
@ -48,7 +48,7 @@ impl Process {
|
||||||
fn run(
|
fn run(
|
||||||
process_path: PathBuf,
|
process_path: PathBuf,
|
||||||
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
|
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
|
||||||
) -> Result<Process, io::Error> {
|
) -> io::Result<Process> {
|
||||||
let child = Command::new(&process_path)
|
let child = Command::new(&process_path)
|
||||||
.args(args)
|
.args(args)
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
|
@ -59,7 +59,7 @@ impl Process {
|
||||||
Ok(Process { path: process_path, child })
|
Ok(Process { path: process_path, child })
|
||||||
}
|
}
|
||||||
|
|
||||||
fn restart(&mut self) -> Result<(), io::Error> {
|
fn restart(&mut self) -> io::Result<()> {
|
||||||
let _ = self.child.kill();
|
let _ = self.child.kill();
|
||||||
self.child = Command::new(&self.path)
|
self.child = Command::new(&self.path)
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
|
@ -196,7 +196,7 @@ fn send_request(
|
||||||
mut writer: &mut impl Write,
|
mut writer: &mut impl Write,
|
||||||
mut reader: &mut impl BufRead,
|
mut reader: &mut impl BufRead,
|
||||||
req: Request,
|
req: Request,
|
||||||
) -> Result<Option<Response>, io::Error> {
|
) -> io::Result<Option<Response>> {
|
||||||
req.write(&mut writer)?;
|
req.write(&mut writer)?;
|
||||||
Ok(Response::read(&mut reader)?)
|
Ok(Response::read(&mut reader)?)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue