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

encoding.base58: fix notice for slice creation #21935

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Conversation

sibkod
Copy link
Contributor

@sibkod sibkod commented Jul 26, 2024

>> compilation failed:
/opt/v/vlib/encoding/base58/base58.v:90:12: notice: an implicit clone of the slice was done here
   88 | 
   89 |     // now encode the values with actual alphabet in-place
   90 |     val := out[i - zcount..]
      |               ~~~~~~~~~~~~~~
   91 |     sz = val.len
   92 |     for i = 0; i < sz; i++ {
Details: /opt/v/vlib/encoding/base58/base58.v:90:12: details: To silence this notice, use either an explicit `a[..].clone()`,
or use an explicit `unsafe{ a[..] }`, if you do not want a copy of the slice.
   88 | 
   89 |     // now encode the values with actual alphabet in-place
   90 |     val := out[i - zcount..]
      |               ~~~~~~~~~~~~~~
   91 |     sz = val.len
   92 |     for i = 0; i < sz; i++ {

@spytheman spytheman changed the title [BASE58] arr.clone() encoding.base58: fix notice for slice creation Jul 26, 2024
Co-authored-by: Delyan Angelov <delian66@gmail.com>
@spytheman spytheman merged commit 52fe7c0 into vlang:master Jul 26, 2024
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants