garando_syntax 0.1.1

Backport of libsyntax
1
2
3
4
5
6
7
8
9
10
11
use crate::{ast, attr};

pub fn injected_crate_name(krate: &ast::Crate) -> Option<&'static str> {
    if attr::contains_name(&krate.attrs, "no_core") {
        None
    } else if attr::contains_name(&krate.attrs, "no_std") {
        Some("core")
    } else {
        Some("std")
    }
}