mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-24 01:52:27 +00:00
Remove unneeded cfg test stringified Namespace parser
This commit is contained in:
parent
047707440c
commit
ce7b37ccb7
@ -123,7 +123,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn make_api(ns: Option<&str>, ident: &str) -> Api {
|
||||
let ns = ns.map_or_else(Namespace::none, Namespace::from_str);
|
||||
let ns = ns.map_or_else(Namespace::none, |ns| syn::parse_str(ns).unwrap());
|
||||
Api::CxxType(ExternType {
|
||||
doc: Doc::new(),
|
||||
type_token: Token),
|
||||
|
@ -1,7 +1,5 @@
|
||||
use crate::syntax::qualified::QualifiedName;
|
||||
use crate::syntax::Api;
|
||||
#[cfg(test)]
|
||||
use proc_macro2::Span;
|
||||
use quote::IdentFragment;
|
||||
use std::fmt::{self, Display};
|
||||
use std::slice::Iter;
|
||||
@ -39,16 +37,6 @@ impl Namespace {
|
||||
input.parse::<Option<Token![,]>>()?;
|
||||
Ok(ns)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn from_str(ns: &str) -> Self {
|
||||
Namespace {
|
||||
segments: ns
|
||||
.split("::")
|
||||
.map(|x| Ident::new(x, Span::call_site()))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for Namespace {
|
||||
|
Loading…
x
Reference in New Issue
Block a user