Skip to content

Commit

Permalink
Dogfood feature(file_buffered)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Sep 24, 2024
1 parent 15d69c9 commit 963cefb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ mod cgroups {
use crate::borrow::Cow;
use crate::ffi::OsString;
use crate::fs::{File, exists};
use crate::io::{BufRead, BufReader, Read};
use crate::io::{BufRead, Read};
use crate::os::unix::ffi::OsStringExt;
use crate::path::{Path, PathBuf};
use crate::str::from_utf8;
Expand Down Expand Up @@ -690,7 +690,7 @@ mod cgroups {
/// If the cgroupfs is a bind mount then `group_path` is adjusted to skip
/// over the already-included prefix
fn find_mountpoint(group_path: &Path) -> Option<(Cow<'static, str>, &Path)> {
let mut reader = BufReader::new(File::open("/proc/self/mountinfo").ok()?);
let mut reader = File::open_buffered("/proc/self/mountinfo").ok()?;
let mut line = String::with_capacity(256);
loop {
line.clear();
Expand Down
1 change: 1 addition & 0 deletions test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#![doc(test(attr(deny(warnings))))]
#![doc(rust_logo)]
#![feature(rustdoc_internals)]
#![feature(file_buffered)]
#![feature(internal_output_capture)]
#![feature(staged_api)]
#![feature(process_exitcode_internals)]
Expand Down
6 changes: 2 additions & 4 deletions test/src/term/terminfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
use std::collections::HashMap;
use std::fs::File;
use std::io::prelude::*;
use std::io::{self, BufReader};
use std::path::Path;
use std::{env, error, fmt};
use std::{env, error, fmt, io};

use parm::{Param, Variables, expand};
use parser::compiled::{msys_terminfo, parse};
Expand Down Expand Up @@ -102,8 +101,7 @@ impl TermInfo {
}
// Keep the metadata small
fn _from_path(path: &Path) -> Result<TermInfo, Error> {
let file = File::open(path).map_err(Error::IoError)?;
let mut reader = BufReader::new(file);
let mut reader = File::open_buffered(path).map_err(Error::IoError)?;
parse(&mut reader, false).map_err(Error::MalformedTerminfo)
}
}
Expand Down

0 comments on commit 963cefb

Please sign in to comment.