Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parse_many return a Result<Vec<Pem>> #28

Merged
merged 2 commits into from
Oct 1, 2021

Conversation

mhils
Copy link
Contributor

@mhils mhils commented Oct 1, 2021

Thanks for the prompt reply in #27! 🍰

This PR changes parse_many to return a Result. Feel free to discard the CHANGELOG.md if you do not want to maintain it, I figured it'd be somewhat useful with the breaking change. 😃

@jcreekmore
Copy link
Owner

You have some test failures:

---- src/lib.rs - parse_many (line 289) stdout ----
error[E0599]: no method named `len` found for enum `std::result::Result<Vec<Pem>, PemError>` in the current scope
  --> src/lib.rs:316:18
   |
30 |  assert_eq!(pems.len(), 2);
   |                  ^^^ method not found in `std::result::Result<Vec<Pem>, PemError>`

error[E0608]: cannot index into a value of type `std::result::Result<Vec<Pem>, PemError>`
  --> src/lib.rs:317:13
   |
31 |  assert_eq!(pems[0].tag, "INTERMEDIATE CERT");
   |             ^^^^^^^

error[E0608]: cannot index into a value of type `std::result::Result<Vec<Pem>, PemError>`
  --> src/lib.rs:318:13
   |
32 |  assert_eq!(pems[1].tag, "CERTIFICATE");
   |             ^^^^^^^

error: aborting due to 3 previous errors

@mhils
Copy link
Contributor Author

mhils commented Oct 1, 2021

I must have missed the doctests somehow, apologies. I've pushed a fix. :)

@jcreekmore jcreekmore merged commit 9206bed into jcreekmore:master Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants