Skip to content

Commit f09f6c2

Browse files
committed
move ResultIntoStreamExt into submodule
1 parent 879b8dd commit f09f6c2

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

custom_debug_derive/src/lib.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
use crate::filter_ext::FilterExt;
2-
use crate::macros::{bail, error};
31
use itertools::Itertools;
42
use proc_macro2::TokenStream;
53
use quote::quote;
64
use syn::spanned::Spanned;
75
use syn::{parse_str, Fields, Ident, Lit, Meta, NestedMeta, Path, Result};
86
use synstructure::{decl_derive, AddBounds, BindingInfo, Structure, VariantInfo};
97

8+
use crate::filter_ext::FilterExt;
9+
use crate::macros::{bail, error};
10+
use crate::result_into_stream_ext::ResultIntoStreamExt;
11+
1012
mod filter_ext;
1113
mod macros;
14+
mod result_into_stream_ext;
1215
#[cfg(test)]
1316
mod tests;
1417

@@ -173,16 +176,3 @@ fn get_metas<'a>(binding: &BindingInfo<'a>) -> impl Iterator<Item = Result<Neste
173176
})
174177
.flatten_ok()
175178
}
176-
177-
trait ResultIntoStreamExt {
178-
fn into_stream(self) -> TokenStream;
179-
}
180-
181-
impl ResultIntoStreamExt for syn::Result<TokenStream> {
182-
fn into_stream(self) -> TokenStream {
183-
match self {
184-
Ok(stream) => stream,
185-
Err(err) => err.into_compile_error(),
186-
}
187-
}
188-
}

0 commit comments

Comments
 (0)