Skip to content

Commit 963cefb

Browse files
committed
Dogfood feature(file_buffered)
1 parent 15d69c9 commit 963cefb

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

std/src/sys/pal/unix/thread.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ mod cgroups {
517517
use crate::borrow::Cow;
518518
use crate::ffi::OsString;
519519
use crate::fs::{File, exists};
520-
use crate::io::{BufRead, BufReader, Read};
520+
use crate::io::{BufRead, Read};
521521
use crate::os::unix::ffi::OsStringExt;
522522
use crate::path::{Path, PathBuf};
523523
use crate::str::from_utf8;
@@ -690,7 +690,7 @@ mod cgroups {
690690
/// If the cgroupfs is a bind mount then `group_path` is adjusted to skip
691691
/// over the already-included prefix
692692
fn find_mountpoint(group_path: &Path) -> Option<(Cow<'static, str>, &Path)> {
693-
let mut reader = BufReader::new(File::open("/proc/self/mountinfo").ok()?);
693+
let mut reader = File::open_buffered("/proc/self/mountinfo").ok()?;
694694
let mut line = String::with_capacity(256);
695695
loop {
696696
line.clear();

test/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![doc(test(attr(deny(warnings))))]
1919
#![doc(rust_logo)]
2020
#![feature(rustdoc_internals)]
21+
#![feature(file_buffered)]
2122
#![feature(internal_output_capture)]
2223
#![feature(staged_api)]
2324
#![feature(process_exitcode_internals)]

test/src/term/terminfo/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
use std::collections::HashMap;
44
use std::fs::File;
55
use std::io::prelude::*;
6-
use std::io::{self, BufReader};
76
use std::path::Path;
8-
use std::{env, error, fmt};
7+
use std::{env, error, fmt, io};
98

109
use parm::{Param, Variables, expand};
1110
use parser::compiled::{msys_terminfo, parse};
@@ -102,8 +101,7 @@ impl TermInfo {
102101
}
103102
// Keep the metadata small
104103
fn _from_path(path: &Path) -> Result<TermInfo, Error> {
105-
let file = File::open(path).map_err(Error::IoError)?;
106-
let mut reader = BufReader::new(file);
104+
let mut reader = File::open_buffered(path).map_err(Error::IoError)?;
107105
parse(&mut reader, false).map_err(Error::MalformedTerminfo)
108106
}
109107
}

0 commit comments

Comments
 (0)