Skip to content

Commit fd073cf

Browse files
committed
Don't construct PathBuf ownership if we don't need it.
1 parent 6e8f92f commit fd073cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/externalfiles.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::fs::File;
1212
use std::io::prelude::*;
1313
use std::io;
14-
use std::path::{PathBuf, Path};
14+
use std::path::Path;
1515
use std::str;
1616

1717
#[derive(Clone)]
@@ -47,8 +47,8 @@ pub fn load_string(input: &Path) -> io::Result<Option<String>> {
4747
macro_rules! load_or_return {
4848
($input: expr, $cant_read: expr, $not_utf8: expr) => {
4949
{
50-
let input = PathBuf::from(&$input[..]);
51-
match ::externalfiles::load_string(&input) {
50+
let input = Path::new(&$input[..]);
51+
match ::externalfiles::load_string(input) {
5252
Err(e) => {
5353
let _ = writeln!(&mut io::stderr(),
5454
"error reading `{}`: {}", input.display(), e);

0 commit comments

Comments
 (0)