Skip to content

Commit

Permalink
client: Include advertised version in BindError::UnsupportVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
hw0lff committed Oct 29, 2023
1 parent 8581b9d commit 9b43e67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wayland-client/src/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl GlobalList {

// Test version requirements
if version < version_start {
return Err(BindError::UnsupportedVersion);
return Err(BindError::UnsupportedVersion(version));
}

// To get the version to bind, take the lower of the version advertised by the server and the maximum
Expand Down Expand Up @@ -232,7 +232,7 @@ impl From<InvalidId> for GlobalError {
#[derive(Debug)]
pub enum BindError {
/// The requested version of the global is not supported.
UnsupportedVersion,
UnsupportedVersion(u32),

/// The requested global was not found in the registry.
NotPresent,
Expand All @@ -243,8 +243,8 @@ impl std::error::Error for BindError {}
impl fmt::Display for BindError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
BindError::UnsupportedVersion {} => {
write!(f, "the requested version of the global is not supported")
BindError::UnsupportedVersion(version) => {
write!(f, "the requested version {version} of the global is not supported")
}
BindError::NotPresent {} => {
write!(f, "the requested global was not found in the registry")
Expand Down

0 comments on commit 9b43e67

Please sign in to comment.