diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-01-11 04:02:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-11 04:02:30 +0100 |
| commit | c960c3e05742f5b4a727b1a9c4d7da185d72ca8c (patch) | |
| tree | 3c537ec496b7efd89e33ec3b0158d7a48354e336 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
| parent | cacda2d7a0d43c6038329e980b8ab339dd0ab9af (diff) | |
| parent | 5f3f1a3606a5f13177a1634ba80d6386e5132518 (diff) | |
| download | rust-c960c3e05742f5b4a727b1a9c4d7da185d72ca8c.tar.gz rust-c960c3e05742f5b4a727b1a9c4d7da185d72ca8c.zip | |
Rollup merge of #68102 - lzutao:inline, r=alexcrichton
Inline some conversion methods around OsStr
Diff on the assembly of this snippet before and after this PR: https://www.diffchecker.com/NeGMjaJ2
```rust
use std::env;
use std::io;
use std::path::{Path, PathBuf};
pub fn cargo_home_with_cwd(cwd: &Path) -> io::Result<PathBuf> {
match env::var_os("CARGO_HOME").filter(|h| !h.is_empty()) {
Some(home) => {
let home = PathBuf::from(home);
if home.is_absolute() {
Ok(home)
} else {
Ok(cwd.join(&home))
}
}
_ => env::home_dir()
.map(|p| p.join(".cargo"))
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "could not find cargo home dir")),
}
}
```
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions
