diff --git a/cairo-example/src/main.rs b/cairo-example/src/main.rs index 3edc0593..53a615d2 100644 --- a/cairo-example/src/main.rs +++ b/cairo-example/src/main.rs @@ -134,13 +134,13 @@ where { let window = conn.generate_id()?; let colormap = conn.generate_id()?; - conn.create_colormap(ColormapAlloc::NONE, colormap, screen.root, visual_id)?; + let _ = conn.create_colormap(ColormapAlloc::NONE, colormap, screen.root, visual_id)?; let win_aux = CreateWindowAux::new() .event_mask(EventMask::EXPOSURE | EventMask::STRUCTURE_NOTIFY) .background_pixel(x11rb::NONE) .border_pixel(screen.black_pixel) .colormap(colormap); - conn.create_window( + let _ = conn.create_window( depth, window, screen.root, @@ -155,28 +155,28 @@ where )?; let title = "Simple Window"; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, window, AtomEnum::WM_NAME, AtomEnum::STRING, title.as_bytes(), )?; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, window, atoms._NET_WM_NAME, atoms.UTF8_STRING, title.as_bytes(), )?; - conn.change_property32( + let _ = conn.change_property32( PropMode::REPLACE, window, atoms.WM_PROTOCOLS, AtomEnum::ATOM, &[atoms.WM_DELETE_WINDOW], )?; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, window, AtomEnum::WM_CLASS, @@ -184,7 +184,7 @@ where b"simple_window\0simple_window\0", )?; - conn.map_window(window)?; + let _ = conn.map_window(window)?; Ok(window) } @@ -268,7 +268,7 @@ fn main() -> Result<(), Box> { width.into(), height.into(), ) - .unwrap(); + .unwrap(); loop { conn.flush()?; diff --git a/x11rb/examples/display_ppm.rs b/x11rb/examples/display_ppm.rs index 82134d56..2a220eb1 100644 --- a/x11rb/examples/display_ppm.rs +++ b/x11rb/examples/display_ppm.rs @@ -29,12 +29,12 @@ fn create_window( let pixmap_id = conn.generate_id()?; let gc_id = conn.generate_id()?; - conn.create_gc( + let _ = conn.create_gc( gc_id, screen.root, &CreateGCAux::default().graphics_exposures(0), )?; - conn.create_pixmap( + let _ = conn.create_pixmap( screen.root_depth, pixmap_id, screen.root, @@ -42,9 +42,9 @@ fn create_window( image.height(), )?; image.put(conn, pixmap_id, gc_id, 0, 0)?; - conn.free_gc(gc_id)?; + let _ = conn.free_gc(gc_id)?; - conn.create_window( + let _ = conn.create_window( screen.root_depth, win_id, screen.root, @@ -57,9 +57,9 @@ fn create_window( 0, &CreateWindowAux::default().background_pixmap(pixmap_id), )?; - conn.free_pixmap(pixmap_id)?; + let _ = conn.free_pixmap(pixmap_id)?; - conn.change_property32( + let _ = conn.change_property32( PropMode::REPLACE, win_id, atoms.WM_PROTOCOLS, @@ -137,7 +137,7 @@ fn main() -> Result<(), Box> { let atoms = Atoms::new(conn)?.reply()?; let win_id = create_window(conn, screen, &atoms, &image)?; - conn.map_window(win_id)?; + let _ = conn.map_window(win_id)?; util::start_timeout_thread(conn1.clone(), win_id); diff --git a/x11rb/examples/hypnomoire.rs b/x11rb/examples/hypnomoire.rs index 16c36b62..1b11959d 100644 --- a/x11rb/examples/hypnomoire.rs +++ b/x11rb/examples/hypnomoire.rs @@ -40,14 +40,14 @@ fn main() -> Result<(), Box> { let white = conn.generate_id()?; let black = conn.generate_id()?; - conn.create_gc( + let _ = conn.create_gc( white, screen.root, &CreateGCAux::new() .graphics_exposures(0) .foreground(screen.white_pixel), )?; - conn.create_gc( + let _ = conn.create_gc( black, screen.root, &CreateGCAux::new() @@ -93,7 +93,7 @@ fn run( guard.angle_velocity = 0.05; } - conn.create_window( + let _ = conn.create_window( COPY_DEPTH_FROM_PARENT, window, screen.root, @@ -111,16 +111,16 @@ fn run( ) .do_not_propogate_mask(EventMask::BUTTON_PRESS), )?; - conn.change_property32( + let _ = conn.change_property32( PropMode::REPLACE, window, wm_protocols, AtomEnum::ATOM, &[wm_delete_window], )?; - conn.map_window(window)?; + let _ = conn.map_window(window)?; - conn.create_pixmap( + let _ = conn.create_pixmap( screen.root_depth, pixmap, window, @@ -133,7 +133,7 @@ fn run( width: default_size, height: default_size, }; - conn.poly_fill_rectangle(pixmap, white, &[rect])?; + let _ = conn.poly_fill_rectangle(pixmap, white, &[rect])?; let mut theta: f64 = 0.0; let radius = f64::from(default_size) + 1.0; @@ -151,7 +151,7 @@ fn run( }, Point { x, y }, ]; - conn.poly_line(CoordMode::PREVIOUS, pixmap, black, &lines)?; + let _ = conn.poly_line(CoordMode::PREVIOUS, pixmap, black, &lines)?; let (sin, cos) = (theta + LAG).sin_cos(); let (x, y) = ((radius * cos) as i16, (radius * sin) as i16); @@ -162,9 +162,9 @@ fn run( }, Point { x, y }, ]; - conn.poly_line(CoordMode::PREVIOUS, pixmap, white, &lines)?; + let _ = conn.poly_line(CoordMode::PREVIOUS, pixmap, white, &lines)?; - conn.copy_area( + let _ = conn.copy_area( pixmap, window, white, @@ -209,7 +209,7 @@ where Event::Expose(event) => { if let Some(state) = find_window_by_id(&windows, event.window) { let state = state.lock().unwrap(); - conn.copy_area( + let _ = conn.copy_area( state.pixmap, state.window, white, diff --git a/x11rb/examples/simple_window_manager.rs b/x11rb/examples/simple_window_manager.rs index 81a4f210..9ce15f06 100644 --- a/x11rb/examples/simple_window_manager.rs +++ b/x11rb/examples/simple_window_manager.rs @@ -63,15 +63,15 @@ impl<'a, C: Connection> WmState<'a, C> { let screen = &conn.setup().roots[screen_num]; let black_gc = conn.generate_id()?; let font = conn.generate_id()?; - conn.open_font(font, b"9x15")?; + let _ = conn.open_font(font, b"9x15")?; let gc_aux = CreateGCAux::new() .graphics_exposures(0) .background(screen.white_pixel) .foreground(screen.black_pixel) .font(font); - conn.create_gc(black_gc, screen.root, &gc_aux)?; - conn.close_font(font)?; + let _ = conn.create_gc(black_gc, screen.root, &gc_aux)?; + let _ = conn.close_font(font)?; let wm_protocols = conn.intern_atom(false, b"WM_PROTOCOLS")?; let wm_delete_window = conn.intern_atom(false, b"WM_DELETE_WINDOW")?; @@ -137,7 +137,7 @@ impl<'a, C: Connection> WmState<'a, C> { | EventMask::ENTER_WINDOW, ) .background_pixel(screen.white_pixel); - self.conn.create_window( + let _ = self.conn.create_window( COPY_DEPTH_FROM_PARENT, frame_win, screen.root, @@ -151,14 +151,14 @@ impl<'a, C: Connection> WmState<'a, C> { &win_aux, )?; - self.conn.grab_server()?; - self.conn.change_save_set(SetMode::INSERT, win)?; + let _ = self.conn.grab_server()?; + let _ = self.conn.change_save_set(SetMode::INSERT, win)?; let cookie = self .conn .reparent_window(win, frame_win, 0, TITLEBAR_HEIGHT as _)?; - self.conn.map_window(win)?; - self.conn.map_window(frame_win)?; - self.conn.ungrab_server()?; + let _ = self.conn.map_window(win)?; + let _ = self.conn.map_window(frame_win)?; + let _ = self.conn.ungrab_server()?; self.windows.push(WindowState::new(win, frame_win, geom)); @@ -174,7 +174,7 @@ impl<'a, C: Connection> WmState<'a, C> { /// Draw the titlebar of a window fn redraw_titlebar(&self, state: &WindowState) -> Result<(), ReplyError> { let close_x = state.close_x_position(); - self.conn.poly_line( + let _ = self.conn.poly_line( CoordMode::ORIGIN, state.frame_window, self.black_gc, @@ -186,7 +186,7 @@ impl<'a, C: Connection> WmState<'a, C> { }, ], )?; - self.conn.poly_line( + let _ = self.conn.poly_line( CoordMode::ORIGIN, state.frame_window, self.black_gc, @@ -212,7 +212,7 @@ impl<'a, C: Connection> WmState<'a, C> { u32::MAX, )? .reply()?; - self.conn + let _ = self.conn .image_text8(state.frame_window, self.black_gc, 1, 10, &reply.value)?; Ok(()) } @@ -289,10 +289,10 @@ impl<'a, C: Connection> WmState<'a, C> { if state.window != event.window { return true; } - conn.change_save_set(SetMode::DELETE, state.window).unwrap(); - conn.reparent_window(state.window, root, state.x, state.y) + let _ = conn.change_save_set(SetMode::DELETE, state.window).unwrap(); + let _ = conn.reparent_window(state.window, root, state.x, state.y) .unwrap(); - conn.destroy_window(state.frame_window).unwrap(); + let _ = conn.destroy_window(state.frame_window).unwrap(); false }); } @@ -307,7 +307,7 @@ impl<'a, C: Connection> WmState<'a, C> { .sibling(None) .stack_mode(None); println!("Configure: {:?}", aux); - self.conn.configure_window(event.window, &aux)?; + let _ = self.conn.configure_window(event.window, &aux)?; Ok(()) } @@ -325,10 +325,10 @@ impl<'a, C: Connection> WmState<'a, C> { fn handle_enter(&mut self, event: EnterNotifyEvent) -> Result<(), ReplyError> { if let Some(state) = self.find_window_by_id(event.event) { // Set the input focus (ignoring ICCCM's WM_PROTOCOLS / WM_TAKE_FOCUS) - self.conn + let _ = self.conn .set_input_focus(InputFocus::PARENT, state.window, CURRENT_TIME)?; // Also raise the window to the top of the stacking order - self.conn.configure_window( + let _ = self.conn.configure_window( state.frame_window, &ConfigureWindowAux::new().stack_mode(StackMode::ABOVE), )?; @@ -360,7 +360,7 @@ impl<'a, C: Connection> WmState<'a, C> { self.wm_protocols, [self.wm_delete_window, 0, 0, 0, 0], ); - self.conn + let _ = self.conn .send_event(false, state.window, EventMask::NO_EVENT, event)?; } } @@ -372,7 +372,7 @@ impl<'a, C: Connection> WmState<'a, C> { let (x, y) = (x + event.root_x, y + event.root_y); // Sigh, X11 and its mixing up i16 and i32 let (x, y) = (x as i32, y as i32); - self.conn + let _ = self.conn .configure_window(win, &ConfigureWindowAux::new().x(x).y(y))?; } Ok(()) diff --git a/x11rb/examples/tutorial.rs b/x11rb/examples/tutorial.rs index 64e1d60c..5560b750 100644 --- a/x11rb/examples/tutorial.rs +++ b/x11rb/examples/tutorial.rs @@ -403,7 +403,7 @@ fn example4() -> Result<(), Box> { let win = conn.generate_id()?; // Create the window - conn.create_window( + let _ = conn.create_window( COPY_DEPTH_FROM_PARENT, // depth (same as root) win, // window Id screen.root, // parent window @@ -418,7 +418,7 @@ fn example4() -> Result<(), Box> { )?; // masks, not used yet // Map the window on the screen - conn.map_window(win)?; + let _ = conn.map_window(win)?; // Make sure commands are sent before the sleep, so window is shown conn.flush()?; @@ -537,7 +537,7 @@ fn example5() -> Result<(), Box> { let win = screen.root; let black = conn.generate_id()?; let values = CreateGCAux::default().foreground(screen.black_pixel); - conn.create_gc(black, win, &values)?; + let _ = conn.create_gc(black, win, &values)?; Ok(()) } @@ -758,7 +758,7 @@ fn example6() -> Result<(), Box> { let values = CreateGCAux::default() .foreground(screen.black_pixel) .graphics_exposures(0); - conn.create_gc(foreground, win, &values)?; + let _ = conn.create_gc(foreground, win, &values)?; // Ask for our window's Id let win = conn.generate_id()?; @@ -767,7 +767,7 @@ fn example6() -> Result<(), Box> { let values = CreateWindowAux::default() .background_pixel(screen.white_pixel) .event_mask(EventMask::EXPOSURE); - conn.create_window( + let _ = conn.create_window( COPY_DEPTH_FROM_PARENT, // depth win, // window Id screen.root, // parent window @@ -782,7 +782,7 @@ fn example6() -> Result<(), Box> { )?; // Map the window on the screen - conn.map_window(win)?; + let _ = conn.map_window(win)?; // We flush the request conn.flush()?; @@ -791,19 +791,19 @@ fn example6() -> Result<(), Box> { let event = conn.wait_for_event()?; if let Event::Expose(_) = event { // We draw the points - conn.poly_point(CoordMode::ORIGIN, win, foreground, &points)?; + let _ = conn.poly_point(CoordMode::ORIGIN, win, foreground, &points)?; // We draw the polygonal line - conn.poly_line(CoordMode::PREVIOUS, win, foreground, &polyline)?; + let _ = conn.poly_line(CoordMode::PREVIOUS, win, foreground, &polyline)?; // We draw the segments - conn.poly_segment(win, foreground, &segments)?; + let _ = conn.poly_segment(win, foreground, &segments)?; // We draw the rectangles - conn.poly_rectangle(win, foreground, &rectangles)?; + let _ = conn.poly_rectangle(win, foreground, &rectangles)?; // We draw the arcs - conn.poly_arc(win, foreground, &arcs)?; + let _ = conn.poly_arc(win, foreground, &arcs)?; // We flush the request conn.flush()?; @@ -1264,7 +1264,7 @@ fn example7() -> Result<(), Box> { | EventMask::KEY_PRESS | EventMask::KEY_RELEASE, ); - conn.create_window( + let _ = conn.create_window( COPY_DEPTH_FROM_PARENT, // depth win, // window Id screen.root, // parent window @@ -1279,7 +1279,7 @@ fn example7() -> Result<(), Box> { )?; // Map the window on the screen - conn.map_window(win)?; + let _ = conn.map_window(win)?; conn.flush()?; loop { @@ -1446,8 +1446,8 @@ fn text_draw( ) -> Result<(), Box> { let gc = gc_font_get(conn, screen, window, "7x13")?; - conn.image_text8(window, gc, x1, y1, label.as_bytes())?; - conn.free_gc(gc)?; + let _ = conn.image_text8(window, gc, x1, y1, label.as_bytes())?; + let _ = conn.free_gc(gc)?; Ok(()) } @@ -1460,16 +1460,16 @@ fn gc_font_get( ) -> Result { let font = conn.generate_id()?; - conn.open_font(font, font_name.as_bytes())?; + let _ = conn.open_font(font, font_name.as_bytes())?; let gc = conn.generate_id()?; let values = CreateGCAux::default() .foreground(screen.black_pixel) .background(screen.white_pixel) .font(font); - conn.create_gc(gc, window, &values)?; + let _ = conn.create_gc(gc, window, &values)?; - conn.close_font(font)?; + let _ = conn.close_font(font)?; Ok(gc) } @@ -1489,7 +1489,7 @@ fn example8() -> Result<(), Box> { let values = CreateWindowAux::default() .background_pixel(screen.white_pixel) .event_mask(EventMask::KEY_RELEASE | EventMask::EXPOSURE); - conn.create_window( + let _ = conn.create_window( screen.root_depth, window, screen.root, @@ -1502,7 +1502,7 @@ fn example8() -> Result<(), Box> { screen.root_visual, &values, )?; - conn.map_window(window)?; + let _ = conn.map_window(window)?; conn.flush()?; @@ -1621,7 +1621,7 @@ fn example9() -> Result<(), Box> { let win = conn.generate_id()?; // Create the window - conn.create_window( + let _ = conn.create_window( 0, win, screen.root, @@ -1637,7 +1637,7 @@ fn example9() -> Result<(), Box> { // Set the title of the window let title = "Hello World !"; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, win, AtomEnum::WM_NAME, @@ -1647,7 +1647,7 @@ fn example9() -> Result<(), Box> { // Set the title of the window icon let title_icon = "Hello World ! (iconified)"; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, win, AtomEnum::WM_ICON_NAME, @@ -1656,7 +1656,7 @@ fn example9() -> Result<(), Box> { )?; // Map the window on the screen - conn.map_window(win)?; + let _ = conn.map_window(win)?; conn.flush()?; @@ -2302,9 +2302,9 @@ fn button_draw( }, Point { x: x1, y: y1 }, ]; - conn.poly_line(CoordMode::ORIGIN, window, gc, &points)?; - conn.image_text8(window, gc, x1 + inset + 1, y1 - inset - 1, label.as_bytes())?; - conn.free_gc(gc)?; + let _ = conn.poly_line(CoordMode::ORIGIN, window, gc, &points)?; + let _ = conn.image_text8(window, gc, x1 + inset + 1, y1 - inset - 1, label.as_bytes())?; + let _ = conn.free_gc(gc)?; Ok(()) } @@ -2317,10 +2317,10 @@ fn cursor_set( cursor_id: u16, ) -> Result<(), ReplyOrIdError> { let font = conn.generate_id()?; - conn.open_font(font, b"cursor")?; + let _ = conn.open_font(font, b"cursor")?; let cursor = conn.generate_id()?; - conn.create_glyph_cursor( + let _ = conn.create_glyph_cursor( cursor, font, font, @@ -2339,13 +2339,13 @@ fn cursor_set( .foreground(screen.black_pixel) .background(screen.black_pixel) .font(font); - conn.create_gc(gc, window, &values)?; + let _ = conn.create_gc(gc, window, &values)?; let values = ChangeWindowAttributesAux::default().cursor(cursor); - conn.change_window_attributes(window, &values)?; + let _ = conn.change_window_attributes(window, &values)?; - conn.free_cursor(cursor)?; - conn.close_font(font)?; + let _ = conn.free_cursor(cursor)?; + let _ = conn.close_font(font)?; Ok(()) } @@ -2364,7 +2364,7 @@ fn example10() -> Result<(), Box> { let values = CreateWindowAux::default() .background_pixel(screen.white_pixel) .event_mask(EventMask::KEY_RELEASE | EventMask::BUTTON_PRESS | EventMask::EXPOSURE); - conn.create_window( + let _ = conn.create_window( screen.root_depth, window, screen.root, @@ -2377,7 +2377,7 @@ fn example10() -> Result<(), Box> { screen.root_visual, &values, )?; - conn.map_window(window)?; + let _ = conn.map_window(window)?; cursor_set(&conn, screen, window, 68)?; diff --git a/x11rb/examples/xclock_utc.rs b/x11rb/examples/xclock_utc.rs index 3d15d5ea..4bcfb780 100644 --- a/x11rb/examples/xclock_utc.rs +++ b/x11rb/examples/xclock_utc.rs @@ -30,7 +30,7 @@ fn create_window( let win_aux = CreateWindowAux::new().event_mask(EventMask::EXPOSURE | EventMask::STRUCTURE_NOTIFY); - conn.create_window( + let _ = conn.create_window( screen.root_depth, win_id, screen.root, @@ -45,21 +45,21 @@ fn create_window( )?; let title = "xclock"; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, win_id, AtomEnum::WM_NAME, AtomEnum::STRING, title.as_bytes(), )?; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, win_id, atoms._NET_WM_NAME, atoms.UTF8_STRING, title.as_bytes(), )?; - conn.change_property32( + let _ = conn.change_property32( PropMode::REPLACE, win_id, atoms.WM_PROTOCOLS, @@ -67,7 +67,7 @@ fn create_window( &[atoms.WM_DELETE_WINDOW], )?; - conn.map_window(win_id)?; + let _ = conn.map_window(win_id)?; Ok(win_id) } @@ -102,8 +102,8 @@ fn redraw( } // Draw the background - conn.change_gc(gc_id, &ChangeGCAux::new().foreground(screen.white_pixel))?; - conn.poly_fill_rectangle( + let _ = conn.change_gc(gc_id, &ChangeGCAux::new().foreground(screen.white_pixel))?; + let _ = conn.poly_fill_rectangle( win_id, gc_id, &[Rectangle { @@ -113,7 +113,7 @@ fn redraw( height, }], )?; - conn.change_gc(gc_id, &ChangeGCAux::new().foreground(screen.black_pixel))?; + let _ = conn.change_gc(gc_id, &ChangeGCAux::new().foreground(screen.black_pixel))?; // Get a list of lines for the clock's face let mut lines = (0..60) @@ -135,7 +135,7 @@ fn redraw( )); // Draw everything - conn.poly_segment(win_id, gc_id, &lines)?; + let _ = conn.poly_segment(win_id, gc_id, &lines)?; // Now draw the hands let point = |pos: (f32, f32), factor: f32| Point { @@ -156,7 +156,7 @@ fn redraw( point(ortho2, hand_width), point(outer, hand_length), ]; - conn.fill_poly( + let _ = conn.fill_poly( win_id, gc_id, PolyShape::COMPLEX, @@ -222,7 +222,7 @@ fn main() -> Result<(), Box> { let win_id = create_window(conn, screen, &atoms, (width, height))?; let gc_id = conn.generate_id().unwrap(); - conn.create_gc(gc_id, win_id, &CreateGCAux::default())?; + let _ = conn.create_gc(gc_id, win_id, &CreateGCAux::default())?; util::start_timeout_thread(conn1.clone(), win_id); diff --git a/x11rb/tests/multithread_test.rs b/x11rb/tests/multithread_test.rs index ddb39d43..a9891d7e 100644 --- a/x11rb/tests/multithread_test.rs +++ b/x11rb/tests/multithread_test.rs @@ -30,7 +30,7 @@ fn multithread_test() { // Just anything, we don't care let event = ClientMessageEvent::new(32, 0, 1u32, [0, 0, 0, 0, 0]); - conn1 + let _ = conn1 .send_event(false, 0u32, EventMask::NO_EVENT, event) .unwrap(); conn1.flush().unwrap(); diff --git a/x11rb/tests/regression_tests.rs b/x11rb/tests/regression_tests.rs index db978eb0..ba05352b 100644 --- a/x11rb/tests/regression_tests.rs +++ b/x11rb/tests/regression_tests.rs @@ -180,7 +180,7 @@ fn test_poly_segment() -> Result<(), ReplyError> { }, ]; let length: u16 = (12 + segments.len() * 8) as u16 / 4; - conn.poly_segment(drawable, gc, &segments)?; + let _ = conn.poly_segment(drawable, gc, &segments)?; let mut expected = vec![ x11rb::protocol::xproto::POLY_SEGMENT_REQUEST, @@ -208,7 +208,7 @@ fn test_big_requests() -> Result<(), ConnectionError> { let padding = 3; // big_buffer's size rounded up to a multiple of 4 let big_request_length_field = 4; let length: u32 = (16 + big_request_length_field + big_buffer.len() as u32 + padding) / 4; - conn.poly_text16(drawable, gc, x, y, &big_buffer)?; + let _ = conn.poly_text16(drawable, gc, x, y, &big_buffer)?; let mut expected = vec![ x11rb::protocol::xproto::POLY_TEXT16_REQUEST, @@ -261,7 +261,7 @@ fn test_send_event() -> Result<(), ConnectionError> { let propagate = true; let destination: u32 = 0x1337; let event_mask = x11rb_protocol::protocol::xproto::EventMask::BUTTON3_MOTION; - conn.send_event(propagate, destination, event_mask, event)?; + let _ = conn.send_event(propagate, destination, event_mask, event)?; let mut expected = vec![x11rb::protocol::xproto::SEND_EVENT_REQUEST, propagate as _]; expected.extend(((12u16 + 32u16) / 4).to_ne_bytes()); diff --git a/xkbcommon-example/src/main.rs b/xkbcommon-example/src/main.rs index 07ecad4c..1f152563 100644 --- a/xkbcommon-example/src/main.rs +++ b/xkbcommon-example/src/main.rs @@ -41,7 +41,7 @@ fn create_window( ) -> Result { let screen = &conn.setup().roots[screen_num]; let window = conn.generate_id()?; - conn.create_window( + let _ = conn.create_window( screen.root_depth, window, screen.root, @@ -57,28 +57,28 @@ fn create_window( .event_mask(EventMask::KEY_PRESS | EventMask::KEY_RELEASE), )?; let title = "Keyboard tester"; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, window, xproto::AtomEnum::WM_NAME, xproto::AtomEnum::STRING, title.as_bytes(), )?; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, window, atoms._NET_WM_NAME, atoms.UTF8_STRING, title.as_bytes(), )?; - conn.change_property32( + let _ = conn.change_property32( PropMode::REPLACE, window, atoms.WM_PROTOCOLS, xproto::AtomEnum::ATOM, &[atoms.WM_DELETE_WINDOW], )?; - conn.change_property8( + let _ = conn.change_property8( PropMode::REPLACE, window, xproto::AtomEnum::WM_CLASS, @@ -115,7 +115,7 @@ fn main() -> Result<(), Box> { | xkb::MapPart::KEY_BEHAVIORS | xkb::MapPart::VIRTUAL_MODS | xkb::MapPart::VIRTUAL_MOD_MAP; - conn.xkb_select_events( + let _ = conn.xkb_select_events( xkb::ID::USE_CORE_KBD.into(), 0u8.into(), events, @@ -138,7 +138,7 @@ fn main() -> Result<(), Box> { // Create and show a window let window = create_window(&conn, screen_num, &atoms)?; - conn.map_window(window)?; + let _ = conn.map_window(window)?; conn.flush()?; // Main loop; wait for events