Skip to content

Commit

Permalink
Don't construct PathBuf ownership if we don't need it.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Oct 9, 2016
1 parent 6e8f92f commit fd073cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/externalfiles.rs
Expand Up @@ -11,7 +11,7 @@
use std::fs::File;
use std::io::prelude::*;
use std::io;
use std::path::{PathBuf, Path};
use std::path::Path;
use std::str;

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

0 comments on commit fd073cf

Please sign in to comment.