Skip to content

Commit

Permalink
Fix compilation error in darling_core tests (#81)
Browse files Browse the repository at this point in the history
This patch fixes three compilation errors in the tests for darling_core
by fixing a wrong variable name and replacing two calls to
Result::ok_err with Result::map_err.  Fixes #80.
  • Loading branch information
robinkrahl authored and TedDriggs committed Sep 24, 2019
1 parent 897d179 commit ab605ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/from_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ mod tests {
/// parse a string as a syn::Meta instance.
fn pm(tokens: TokenStream) -> ::std::result::Result<syn::Meta, String> {
let attribute: syn::Attribute = parse_quote!(#[#tokens]);
attribute.parse_meta().ok_or("Unable to parse".into())
attribute.parse_meta().map_err(|_| "Unable to parse".into())
}

fn fm<T: FromMeta>(tokens: TokenStream) -> T {
Expand Down
4 changes: 2 additions & 2 deletions core/src/util/path_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mod tests {
/// parse a string as a syn::Meta instance.
fn pm(tokens: TokenStream) -> ::std::result::Result<Meta, String> {
let attribute: Attribute = parse_quote!(#[#tokens]);
attribute.parse_meta().ok_or("Unable to parse".into())
attribute.parse_meta().map_err(|_| "Unable to parse".into())
}

fn fm<T: FromMeta>(tokens: TokenStream) -> T {
Expand All @@ -82,7 +82,7 @@ mod tests {
fn succeeds() {
let paths = fm::<PathList>(quote!(ignore(Debug, Clone, Eq)));
assert_eq!(
idents.to_strings(),
paths.to_strings(),
vec![
String::from("Debug"),
String::from("Clone"),
Expand Down

0 comments on commit ab605ec

Please sign in to comment.