Skip to content

Commit

Permalink
Merge pull request #910 from psychon/update-deps
Browse files Browse the repository at this point in the history
Update some dependencies
  • Loading branch information
mergify[bot] authored Nov 26, 2023
2 parents d043410 + 5a958d9 commit b8ad2e7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion extract-generated-code-doc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
regex = "1.9"
regex = "1.10"
4 changes: 2 additions & 2 deletions generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
roxmltree = "0.18.0"
roxmltree = "0.19.0"
xcbgen = { path = "../xcbgen-rs" }
regex = "1.9"
regex = "1.10"
2 changes: 1 addition & 1 deletion x11rb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gethostname = "0.4"

[dev-dependencies]
gethostname = "0.4"
polling = "2.8.0"
polling = "3.3.1"
tracing-subscriber = "0.3"

[features]
Expand Down
11 changes: 8 additions & 3 deletions x11rb/examples/xclock_utc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::num::NonZeroUsize;
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};

use polling::{Event as PollingEvent, Poller};
Expand Down Expand Up @@ -173,22 +174,26 @@ fn poll_with_timeout(
timeout: Duration,
) -> Result<(), Box<dyn std::error::Error>> {
// Add interest in the connection's stream.
poller.add(conn.stream(), PollingEvent::readable(1))?;
unsafe {
// SAFETY: The guard bellow guarantees that the source will be removed
// from the poller.
poller.add(conn.stream(), PollingEvent::readable(1))?;
}

// Remove it if we time out.
let _guard = CallOnDrop(|| {
poller.delete(conn.stream()).ok();
});

// Wait for events.
let mut event = Vec::with_capacity(1);
let mut event = polling::Events::with_capacity(NonZeroUsize::new(1).unwrap());
let target = Instant::now() + timeout;
loop {
let remaining = target.saturating_duration_since(Instant::now());
poller.wait(&mut event, Some(remaining))?;

// If we received an event, we're done.
if event.contains(&PollingEvent::readable(1)) {
if event.iter().any(|event| event.readable) {
return Ok(());
}

Expand Down
2 changes: 1 addition & 1 deletion xcbgen-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ publish = false

[dependencies]
once_cell = "1.17.0"
roxmltree = "0.18.0"
roxmltree = "0.19.0"

0 comments on commit b8ad2e7

Please sign in to comment.