Skip to content

unused qualifications#9

Merged
bors[bot] merged 3 commits into
rust-num:masterfrom
Pzixel:master
Jan 26, 2018
Merged

unused qualifications#9
bors[bot] merged 3 commits into
rust-num:masterfrom
Pzixel:master

Conversation

@Pzixel

@Pzixel Pzixel commented Jan 26, 2018

Copy link
Copy Markdown
Contributor

This code won't work on 0.1.43:

#![deny(trivial_numeric_casts)]
#![deny(unused_qualifications)]
extern crate num;
#[macro_use]
extern crate num_derive;
use num::ToPrimitive;

#[derive(ToPrimitive)]
pub enum SomeEnum {
    A = 1
}

fn main() {
    println!("{}", SomeEnum::A.to_i64().unwrap())
}

This is an attempt to fix it

@cuviper

cuviper commented Jan 26, 2018

Copy link
Copy Markdown
Member

Wow, you're tough on your code -- that lint is default-allow!

The change is fine, but can you also exercise the "deny" in a test?

@Pzixel

Pzixel commented Jan 26, 2018

Copy link
Copy Markdown
Contributor Author

Ok, I'm going to add tests.

@cuviper

cuviper commented Jan 26, 2018

Copy link
Copy Markdown
Member

Great, thanks, and I've extended this for FromPrimitive too.

bors r+

bors Bot added a commit that referenced this pull request Jan 26, 2018
9: unused qualifications r=cuviper a=Pzixel

This code won't work on 0.1.43:
```rust
#![deny(trivial_numeric_casts)]
#![deny(unused_qualifications)]
extern crate num;
#[macro_use]
extern crate num_derive;
use num::ToPrimitive;

#[derive(ToPrimitive)]
pub enum SomeEnum {
    A = 1
}

fn main() {
    println!("{}", SomeEnum::A.to_i64().unwrap())
}
```
This is an attempt to fix it
@bors

bors Bot commented Jan 26, 2018

Copy link
Copy Markdown
Contributor

Build succeeded

@bors bors Bot merged commit 13e8c1f into rust-num:master Jan 26, 2018
@cuviper

cuviper commented Jan 26, 2018

Copy link
Copy Markdown
Member

Published!

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