Update Rust crate getrandom to 0.4 - #33
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe Cargo manifest updates the ChangesDependency update
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Cargo.toml`:
- Line 13: Update the getrandom call in the ID generation logic of
src/app/ids.rs to use getrandom::fill instead of the removed
getrandom::getrandom API, preserving the existing buffer and error-handling
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 941d1b25-8253-46b7-9b13-51969ac343f2
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
Cargo.toml
| [dependencies] | ||
| cef = { version = "=150.2.1", default-features = false } | ||
| getrandom = "0.2" | ||
| getrandom = "0.4" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== Cargo.toml ==\n'
nl -ba Cargo.toml | sed -n '1,40p'
printf '\n== src/app/ids.rs ==\n'
nl -ba src/app/ids.rs | sed -n '1,120p'
printf '\n== getrandom references ==\n'
rg -n "getrandom::|getrandom =" -S .Repository: phob/MediaFlick-Desktop
Length of output: 219
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
import pathlib, re, sys
path = pathlib.Path("Cargo.toml")
text = path.read_text()
m = re.search(r'^\s*getrandom\s*=\s*"([^"]+)"', text, re.M)
print("Cargo.toml getrandom version:", m.group(1) if m else "not found")
PYRepository: phob/MediaFlick-Desktop
Length of output: 195
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '1,120p' src/app/ids.rs | nl -baRepository: phob/MediaFlick-Desktop
Length of output: 201
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
for p in [Path("Cargo.toml"), Path("src/app/ids.rs")]:
print(f"\n## {p}")
if p.exists():
for i, line in enumerate(p.read_text().splitlines(), 1):
if p.name == "Cargo.toml" and i <= 30:
print(f"{i:>4}: {line}")
elif p.name == "ids.rs" and i <= 60:
print(f"{i:>4}: {line}")
else:
print("missing")
PYRepository: phob/MediaFlick-Desktop
Length of output: 2717
🌐 Web query:
getrandom 0.4 docs getrandom function renamed to fill removed
💡 Result:
In the getrandom crate, starting with version 0.4.0, the functions previously known as getrandom and getrandom_uninit were renamed to fill and fill_uninit, respectively [1][2][3]. This change was implemented to provide more concise and descriptive naming conventions for the library's primary functions [3]. As of version 0.4.x, you should use getrandom::fill to populate a byte buffer with random data: use getrandom::fill; let mut buf = [0u8; 32]; fill(&mut buf)?; For working with potentially uninitialized memory, the corresponding function is now fill_uninit [4][5]. These changes were part of a series of updates in the 0.4 release cycle [1][6].
Citations:
- 1: https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md
- 2: rust-random/getrandom@v0.2.17...v0.4.1
- 3: Rename
getrandom(_uninit)tofill(_uninit)rust-random/getrandom#532 - 4: https://docs.rs/getrandom/latest/getrandom/index.html
- 5: https://github.com/rust-random/getrandom?tab=readme-ov-file
- 6: https://docs.rs/crate/getrandom/^0.4
Update src/app/ids.rs for getrandom 0.4
getrandom::getrandom was removed in 0.4; switch the call at src/app/ids.rs:13 to getrandom::fill, or this dependency bump will fail to compile.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Cargo.toml` at line 13, Update the getrandom call in the ID generation logic
of src/app/ids.rs to use getrandom::fill instead of the removed
getrandom::getrandom API, preserving the existing buffer and error-handling
behavior.
fa230aa to
bfbc092
Compare
d0c7b29 to
96fb8e5
Compare
96fb8e5 to
d5adc55
Compare
d5adc55 to
f91ba27
Compare
This PR contains the following updates:
0.3→0.4Release Notes
rust-random/getrandom (getrandom)
v0.4.3Compare Source
Added
wasm64-unknown-unknowntarget support forwasm_jsbackend #848Changed
wasip2andwasip3dependencies in favor of manual bindings #830v0.4.2Compare Source
Changed
r-efidependency to v6 #814Fixed
errnoonly when it is set #810ProcessPrngon Windows #811v0.4.1Compare Source
Fixed
v0.4.0Compare Source
Added
RawOsErrortype alias #739SysRngbehind new featuresys_rng#751extern_implopt-in backend #786 #794Changed
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.