Commit ab4d5b70 authored by Zeeshan Ali's avatar Zeeshan Ali

piped_stdio: Use std::env using 'use'

Attempting to fix an error from CI:

error[E0658]: access to extern crates through prelude is experimental (see issue #44660)
  --> tools/src/piped_stdio.rs:16:23
   |
16 |         let cmdline = std::env::var_os("PAGER").unwrap_or(OsString::from(DEFAULT_PAGER));
   |                       ^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.

https://gitlab.freedesktop.org/zeenix/gstreamer-rs/-/jobs/45439
parent 54828dd0
Pipeline #8912 passed with stages
in 8 minutes and 54 seconds
use nix::unistd::dup2;
use std::env;
use std::ffi::OsString;
use std::fs::File;
use std::io::{stderr, stdin, stdout, Error, ErrorKind, Result, Write};
......@@ -13,7 +14,7 @@ pub struct PipedStdio {
impl PipedStdio {
pub fn new() -> Result<Self> {
let cmdline = std::env::var_os("PAGER").unwrap_or(OsString::from(DEFAULT_PAGER));
let cmdline = env::var_os("PAGER").unwrap_or(OsString::from(DEFAULT_PAGER));
let mut cmd: Vec<&str> = cmdline.to_str().unwrap().split(" ").collect();
let mut pager = Command::new(OsString::from(cmd.remove(0)))
.stdin(Stdio::piped())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment