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

Clippy and format fixes #27

Closed
wants to merge 16 commits into from
Closed

Clippy and format fixes #27

wants to merge 16 commits into from

Conversation

k-nasa
Copy link
Contributor

@k-nasa k-nasa commented Aug 11, 2019

Description

Clippy and format fixes.

How Has This Been Tested?

Run test code.

Types of changes

  • Refactor

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@gameldar
Copy link

Nice - I had been fixing these as well.

If this is running in CI with the same clippy rules as Tide then it is still going to fail (once the feature flag is merged) with the following error:

error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
  --> src\lib.rs:90:5
   |
90 | /     pub fn iter<'a>(&'a self) -> Iter<'a> {
91 | |         Iter(self.map.iter())
92 | |     }
   | |_____^
   |
   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

error: aborting due to previous error

Looks like it still needs that addressed with the following:

@@ -85,11 +85,11 @@ impl Params {
 
     pub fn find(&self, key: &str) -> Option<&str> {
         self.map.get(key).map(|s| &s[..])
     }
 
-    pub fn iter<'a>(&'a self) -> Iter<'a> {
+    pub fn iter(& self) -> Iter<> {
         Iter(self.map.iter())
     }
 }
 
 impl<'a> Index<&'a str> for Params {

@k-nasa
Copy link
Contributor Author

k-nasa commented Aug 12, 2019

thx gameldar. I fixed it by 418d003

@gameldar
Copy link

Looks good to me now - I'd merged it if I could :)

@Nemo157
Copy link
Contributor

Nemo157 commented Aug 12, 2019

I think we should release a new patch version and merge this for the next minor version bump, I think the '_ lifetime will require a newer compiler than what the current release requires (although there's no published minimum compiler version currently).

I'm planning on doing a release in a few hours to get the fix for compiling on current nightly out, then I could merge this.

@Nemo157 Nemo157 mentioned this pull request Aug 12, 2019
12 tasks
@Nemo157
Copy link
Contributor

Nemo157 commented Aug 12, 2019

@k-nasa so that we can try and get this crate relicensed, can you make a statement like:

I license this contribution under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option

(I'll try and add something to the repo for future PRs soon, but want to wait and see if there's any movement on #19 first).

@k-nasa
Copy link
Contributor Author

k-nasa commented Aug 13, 2019

@Nemo157 I added a lot. Is this all right?
I am not good at english
I may have misunderstood

@gameldar
Copy link

I think Nemo meant to add that text as a comment on Issue #19 saying that you are fine with changing the license to the dual license since you are committing under the old license.

But what you have done does need doing - so we can still use that - we just need to still get approval for the change from Alex and Wycats

Nemo157 added a commit that referenced this pull request Aug 13, 2019
@Nemo157 Nemo157 mentioned this pull request Aug 13, 2019
8 tasks
@Nemo157
Copy link
Contributor

Nemo157 commented Aug 13, 2019

Yeah, that's what I meant, but this works fine as well. I've merged the original clippy and format fixes in, and split the rest of the changes off to #32.

@Nemo157 Nemo157 closed this Aug 13, 2019
@k-nasa k-nasa deleted the fix_clippy branch August 14, 2019 00:38
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.

3 participants