Skip to content

Rollup of 8 pull requests #129108

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

Merged
merged 23 commits into from
Aug 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
89f3064
Add powerpc-unknown-linux-muslspe compile target
BKPepe Aug 8, 2022
ba62034
Hash Ipv*Addr as an integer
orlp Aug 10, 2024
a04a1e4
Fix stability annotation and expand comment
orlp Aug 10, 2024
fce1dec
Do not use unnecessary endian conversion.
orlp Aug 11, 2024
18d6200
Add possibility to generate rustdoc JSON output to stdout
GuillaumeGomez Aug 11, 2024
e2fd0c0
Add `read_dir_entries_recursive` in `run_make_support`
GuillaumeGomez Aug 12, 2024
7882575
Add `run-make` test for `-` for `-o` option
GuillaumeGomez Aug 12, 2024
63ab7b5
Add documentation for `-o -`
GuillaumeGomez Aug 12, 2024
a719514
Update books
rustbot Aug 12, 2024
5534cb0
derive(SmartPointer): register helper attributes
dingxiangfei2009 Aug 10, 2024
0a34ce4
Add and use `IndexVec::append`
cuviper Aug 13, 2024
ce67e68
Update `indexmap` and use `IndexMap::append`
cuviper Aug 13, 2024
5ae0386
CommandExt::before_exec: deprecate safety in edition 2024
RalfJung Jun 4, 2024
e29360c
Update Cargo.lock
ehuss Aug 14, 2024
4a2d0d9
Fix dependencies cron job
ehuss Aug 14, 2024
0bed4d1
Rollup merge of #125970 - RalfJung:before_exec, r=m-ou-se
matthiaskrgr Aug 14, 2024
442ba18
Rollup merge of #127905 - BKPepe:powerpc-muslspe, r=wesleywiser
matthiaskrgr Aug 14, 2024
9938349
Rollup merge of #128925 - dingxiangfei2009:smart-ptr-helper-attr, r=c…
matthiaskrgr Aug 14, 2024
cd1b42c
Rollup merge of #128946 - orlp:faster-ip-hash, r=joboet
matthiaskrgr Aug 14, 2024
6c242a0
Rollup merge of #128963 - GuillaumeGomez:output-to-stdout, r=aDotInTh…
matthiaskrgr Aug 14, 2024
d14fa85
Rollup merge of #129015 - rustbot:docs-update, r=ehuss
matthiaskrgr Aug 14, 2024
c582c0c
Rollup merge of #129067 - cuviper:append, r=wesleywiser
matthiaskrgr Aug 14, 2024
e14f171
Rollup merge of #129100 - ehuss:fix-dependencies-update, r=Kobzol
matthiaskrgr Aug 14, 2024
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
Prev Previous commit
Next Next commit
Do not use unnecessary endian conversion.
  • Loading branch information
orlp committed Aug 11, 2024
commit fce1decc3c6508aa72f590d024e583dd5c0cf04d
10 changes: 4 additions & 6 deletions library/core/src/net/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ impl Hash for Ipv4Addr {
fn hash<H: Hasher>(&self, state: &mut H) {
// Hashers are often more efficient at hashing a fixed-width integer
// than a bytestring, so convert before hashing. We don't use to_bits()
// here as that involves a byteswap on little-endian machines, which are
// more common than big-endian machines.
u32::from_le_bytes(self.octets).hash(state);
// here as that may involve a byteswap which is unnecessary.
u32::from_ne_bytes(self.octets).hash(state);
}
}

Expand Down Expand Up @@ -172,9 +171,8 @@ impl Hash for Ipv6Addr {
fn hash<H: Hasher>(&self, state: &mut H) {
// Hashers are often more efficient at hashing a fixed-width integer
// than a bytestring, so convert before hashing. We don't use to_bits()
// here as that involves byteswaps on little-endian machines, which are
// more common than big-endian machines.
u128::from_le_bytes(self.octets).hash(state);
// here as that may involve unnecessary byteswaps.
u128::from_ne_bytes(self.octets).hash(state);
}
}

Expand Down
Loading