Removing superflous check for nightly

This commit is contained in:
Tomasz Drwięga
2016-03-11 11:16:49 +01:00
parent a8a21da9ba
commit d84e008e00
35 changed files with 56 additions and 131 deletions

View File

@@ -305,7 +305,7 @@ macro_rules! impl_hash {
}
impl Copy for $from {}
#[cfg_attr(all(nightly, feature="dev"), allow(expl_impl_clone_on_copy))]
#[cfg_attr(feature="dev", allow(expl_impl_clone_on_copy))]
impl Clone for $from {
fn clone(&self) -> $from {
unsafe {
@@ -637,7 +637,7 @@ mod tests {
use std::str::FromStr;
#[test]
#[cfg_attr(all(nightly, feature="dev"), allow(eq_op))]
#[cfg_attr(feature="dev", allow(eq_op))]
fn hash() {
let h = H64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef]);
assert_eq!(H64::from_str("0123456789abcdef").unwrap(), h);

View File

@@ -15,18 +15,18 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
#![warn(missing_docs)]
#![cfg_attr(all(nightly, feature="dev"), feature(plugin))]
#![cfg_attr(all(nightly, feature="dev"), plugin(clippy))]
#![cfg_attr(feature="dev", feature(plugin))]
#![cfg_attr(feature="dev", plugin(clippy))]
// Clippy settings
// TODO [todr] not really sure
#![cfg_attr(all(nightly, feature="dev"), allow(needless_range_loop))]
#![cfg_attr(feature="dev", allow(needless_range_loop))]
// Shorter than if-else
#![cfg_attr(all(nightly, feature="dev"), allow(match_bool))]
#![cfg_attr(feature="dev", allow(match_bool))]
// We use that to be more explicit about handled cases
#![cfg_attr(all(nightly, feature="dev"), allow(match_same_arms))]
#![cfg_attr(feature="dev", allow(match_same_arms))]
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
#![cfg_attr(all(nightly, feature="dev"), allow(clone_on_copy))]
#![cfg_attr(feature="dev", allow(clone_on_copy))]
//! Ethcore-util library
//!

View File

@@ -243,7 +243,7 @@ impl Discovery {
self.send_to(packet, address.clone());
}
#[cfg_attr(all(nightly, feature="dev"), allow(map_clone))]
#[cfg_attr(feature="dev", allow(map_clone))]
fn nearest_node_entries(target: &NodeId, buckets: &[NodeBucket]) -> Vec<NodeEntry> {
let mut found: BTreeMap<u32, Vec<&NodeEntry>> = BTreeMap::new();
let mut count = 0;

View File

@@ -507,7 +507,7 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
debug!(target: "network", "Connecting peers: {} sessions, {} pending", self.session_count(), self.handshake_count());
}
#[cfg_attr(all(nightly, feature="dev"), allow(single_match))]
#[cfg_attr(feature="dev", allow(single_match))]
fn connect_peer(&self, id: &NodeId, io: &IoContext<NetworkIoMessage<Message>>) {
if self.have_session(id)
{
@@ -542,7 +542,7 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
self.create_connection(socket, Some(id), io);
}
#[cfg_attr(all(nightly, feature="dev"), allow(block_in_if_condition_stmt))]
#[cfg_attr(feature="dev", allow(block_in_if_condition_stmt))]
fn create_connection(&self, socket: TcpStream, id: Option<&NodeId>, io: &IoContext<NetworkIoMessage<Message>>) {
let nonce = self.info.write().unwrap().next_nonce();
let mut handshakes = self.handshakes.write().unwrap();

View File

@@ -71,7 +71,7 @@ impl PanicHandler {
/// Invoke closure and catch any possible panics.
/// In case of panic notifies all listeners about it.
#[cfg_attr(all(nightly, feature="dev"), allow(deprecated))]
#[cfg_attr(feature="dev", allow(deprecated))]
pub fn catch_panic<G, R>(&self, g: G) -> thread::Result<R> where G: FnOnce() -> R + Send + 'static {
let _guard = PanicGuard { handler: self };
let result = g();

View File

@@ -54,7 +54,7 @@ pub struct TrieDB<'db> {
pub hash_count: usize,
}
#[cfg_attr(all(nightly, feature="dev"), allow(wrong_self_convention))]
#[cfg_attr(feature="dev", allow(wrong_self_convention))]
impl<'db> TrieDB<'db> {
/// Create a new trie with the backing database `db` and `root`
/// Panics, if `root` does not exist

View File

@@ -66,7 +66,7 @@ enum MaybeChanged<'a> {
Changed(Bytes),
}
#[cfg_attr(all(nightly, feature="dev"), allow(wrong_self_convention))]
#[cfg_attr(feature="dev", allow(wrong_self_convention))]
impl<'db> TrieDBMut<'db> {
/// Create a new trie with the backing database `db` and empty `root`
/// Initialise to the state entailed by the genesis block.
@@ -350,7 +350,7 @@ impl<'db> TrieDBMut<'db> {
}
}
#[cfg_attr(all(nightly, feature="dev"), allow(cyclomatic_complexity))]
#[cfg_attr(feature="dev", allow(cyclomatic_complexity))]
/// Determine the RLP of the node, assuming we're inserting `partial` into the
/// node currently of data `old`. This will *not* delete any hash of `old` from the database;
/// it will just return the new RLP that includes the new node.