Use current_dir instead of cargo_metadata

Co-Authored-By: lzutao <taolzu@gmail.com>
This commit is contained in:
Philipp Krones 2020-02-10 16:42:50 +01:00 committed by GitHub
parent f940b04de6
commit c86c09b19a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,3 @@
use cargo_metadata::MetadataCommand;
use lazy_static::lazy_static;
use std::env;
use std::path::PathBuf;
@ -7,7 +6,7 @@ lazy_static! {
pub static ref CARGO_TARGET_DIR: PathBuf = {
match env::var_os("CARGO_TARGET_DIR") {
Some(v) => v.into(),
None => MetadataCommand::new().exec().unwrap().target_directory,
None => env::current_dir().unwrap().join("target"),
}
};
pub static ref TARGET_LIB: PathBuf = {