Skip to content

Commit aa945dd

Browse files
authored
use path.join instead of hardcoded / (#663)
1 parent fd7866c commit aa945dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

webrtc-sys/build/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use std::path::PathBuf;
1516
use std::{
1617
env,
1718
error::Error,
@@ -194,9 +195,9 @@ pub fn download_webrtc() -> Result<(), Box<dyn Error>> {
194195
return Err(format!("failed to download webrtc: {}", resp.status()).into());
195196
}
196197

197-
let tmp_path = env::var("OUT_DIR").unwrap() + "/webrtc.zip";
198-
let tmp_path = path::Path::new(&tmp_path);
199-
let mut file = fs::File::options().write(true).read(true).create(true).open(tmp_path)?;
198+
let out_dir = env::var("OUT_DIR").unwrap();
199+
let tmp_path = PathBuf::from(out_dir).join("webrtc.zip");
200+
let mut file = fs::File::options().write(true).read(true).create(true).open(&tmp_path)?;
200201
resp.copy_to(&mut file)?;
201202

202203
let mut archive = zip::ZipArchive::new(file)?;

0 commit comments

Comments
 (0)