Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy complaint in generator/ and x11rb-protocol/benches/ #752

Merged
merged 2 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generator/src/generator/special_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub(super) fn handle_request(request_def: &xcbdefs::RequestDef, out: &mut Output
/// ```
/// // First, we have to 'invent' a GetPropertyReply.
/// let reply = x11rb_protocol::protocol::xproto::GetPropertyReply {{
/// format: {},
/// format: {width},
/// sequence: 0,
/// length: 0, // This value is incorrect
/// type_: 0, // This value is incorrect
Expand Down
4 changes: 2 additions & 2 deletions x11rb-protocol/benches/proto_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn enqueue_packet_test(c: &mut Criterion) {
v[0] = ind;

// copy our_seqno to bytes 3 and 4
(&mut v[2..4]).copy_from_slice(&our_seqno.to_ne_bytes());
v[2..4].copy_from_slice(&our_seqno.to_ne_bytes());

v
};
Expand Down Expand Up @@ -190,7 +190,7 @@ fn send_and_receive_request(c: &mut Criterion) {
let seq_trunc = seq as u16;

// insert the sequence number at positions 2 and 3
(&mut packet[2..4]).copy_from_slice(&seq_trunc.to_ne_bytes());
packet[2..4].copy_from_slice(&seq_trunc.to_ne_bytes());

// enqueue the packet
conn.enqueue_packet(black_box(replace(&mut packet, vec![0u8; 32])));
Expand Down