1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

Remove unused crate_modules feature (#7311)

This commit is contained in:
Ryan Dahl 2020-09-01 13:55:40 -04:00 committed by GitHub
parent 87e513ffc5
commit fee6f79330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 26 deletions

View file

@ -64,5 +64,3 @@ pub fn v8_version() -> &'static str {
fn test_v8_version() {
assert!(v8_version().len() > 3);
}
crate_modules!();

View file

@ -516,26 +516,6 @@ impl fmt::Display for Deps {
}
}
#[macro_export]
macro_rules! crate_modules {
() => {
pub const DENO_CRATE_PATH: &'static str = env!("CARGO_MANIFEST_DIR");
};
}
#[macro_export]
macro_rules! include_crate_modules {
( $( $x:ident ),* ) => {
{
let mut temp: HashMap<String, String> = HashMap::new();
$(
temp.insert(stringify!($x).to_string(), $x::DENO_CRATE_PATH.to_string());
)*
temp
}
};
}
#[cfg(test)]
mod tests {
use super::*;

View file

@ -1,10 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use deno_core::crate_modules;
use std::path::PathBuf;
crate_modules!();
pub struct WebScripts {
pub abort_signal: String,
pub declaration: String,
@ -14,7 +11,7 @@ pub struct WebScripts {
}
fn get_str_path(file_name: &str) -> String {
PathBuf::from(DENO_CRATE_PATH)
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join(file_name)
.to_string_lossy()
.to_string()