Mercurial > crates > nonstick
comparison src/conv.rs @ 12:30831c70e5c0
Remove PhantomData usage.
PhantomData is used through the library to substitute associated
constants (to types). However, calling
`PamItem::item_type(PhantomData<T>)` can easily be substituted by
calling `T::item_type()`, getting rid of the need for PhantomData.
| author | Marc Brinkmann <git@marcbrinkmann.de> |
|---|---|
| date | Sun, 26 Feb 2017 12:12:36 +0100 |
| parents | a83c56216e21 |
| children | 51b097c12d3c |
comparison
equal
deleted
inserted
replaced
| 11:827faa554528 | 12:30831c70e5c0 |
|---|---|
| 1 use libc::{c_char, c_int}; | 1 use libc::{c_char, c_int}; |
| 2 use std::ptr; | 2 use std::ptr; |
| 3 use std::ffi::{CStr, CString}; | 3 use std::ffi::{CStr, CString}; |
| 4 use std::marker::PhantomData; | |
| 5 | 4 |
| 6 use constants; | 5 use constants; |
| 7 use constants::*; | 6 use constants::*; |
| 8 use module::{PamItem, PamResult}; | 7 use module::{PamItem, PamResult}; |
| 9 | 8 |
| 74 } | 73 } |
| 75 } | 74 } |
| 76 } | 75 } |
| 77 | 76 |
| 78 impl PamItem for PamConv { | 77 impl PamItem for PamConv { |
| 79 fn item_type(_: PhantomData<Self>) -> PamItemType { | 78 fn item_type() -> PamItemType { |
| 80 PAM_CONV | 79 PAM_CONV |
| 81 } | 80 } |
| 82 } | 81 } |
