Skip to content

Commit

Permalink
Replace ATOMIC_USIZE_INIT with AtomicUsize::new(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
locka99 committed Apr 18, 2019
1 parent 3d750cf commit 2eefebe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Planned future work is listed at the bottom.
- Rust 2018. All `Cargo.toml` files now contain `edition = "2018"` and the code has been cleaned up to benefit from
some of the improvements in the language. e.g. many `extern crate` declarations have been removed. Your own code
can be Rust 2015 but you must build with Rust 1.31 or later.
- Client API has been simplified for ad hoc connections and now has more documentation.
- Client API has been simplified for ad hoc connections and with better documentation.
- Client API will reconnect and restore subscriptions after a disconnect from a server. Reconnection is
controlled by a session retry policy.
- Improved subscription & monitored item behaviour in server, e.g. notifications are acknowledged upon
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Read the [change log](./CHANGELOG.md) for changes per version as well as aspirat

Read the [compatibility](./docs/compatibility.md) page for how the implementation conforms with the OPC UA spec.

The API documentation is generated from the latest published crates which may be some way behind current development.
The API documentation is generated from the latest published crates. This may be some way behind current development.

<table>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions integration/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{
sync::{
Arc, Mutex, RwLock, mpsc, mpsc::channel,
atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT},
atomic::{AtomicUsize, Ordering},
},
thread, time,
};
Expand Down Expand Up @@ -142,7 +142,7 @@ fn connect_basic256sha256_sign_and_encrypt() {
connect_with(next_port_offset(), ENDPOINT_ID_BASIC256SHA256_SIGN_ENCRYPT);
}

static NEXT_PORT_OFFSET: AtomicUsize = ATOMIC_USIZE_INIT;
static NEXT_PORT_OFFSET: AtomicUsize = AtomicUsize::new(0);

fn next_port_offset() -> u16 {
// hand out an incrementing port so tests can be run in parallel without interfering with each other
Expand Down
4 changes: 2 additions & 2 deletions types/src/node_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
self, u16, u32,
fmt,
io::{Read, Write}, str::FromStr,
sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering},
sync::atomic::{AtomicUsize, Ordering},
};

use crate::{
Expand Down Expand Up @@ -341,7 +341,7 @@ impl From<(u16, ByteString)> for NodeId {
}
}

static NEXT_NODE_ID_NUMERIC: AtomicUsize = ATOMIC_USIZE_INIT;
static NEXT_NODE_ID_NUMERIC: AtomicUsize = AtomicUsize::new(0);

impl Default for NodeId {
fn default() -> Self {
Expand Down

0 comments on commit 2eefebe

Please sign in to comment.