Skip to content

Conversation

@jungseoklee
Copy link
Contributor

This patch addresses the following warnings:

  warning: use of deprecated function `base64::encode`: Use Engine::encode
   --> src/bin/base64.rs:3:14
    |
  3 | use base64::{encode, decode};
    |              ^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

  warning: use of deprecated function `base64::decode`: Use Engine::decode
   --> src/bin/base64.rs:3:22
    |
  3 | use base64::{encode, decode};
    |                      ^^^^^^

  warning: use of deprecated function `base64::encode`: Use Engine::encode
   --> src/bin/base64.rs:7:17
    |
  7 |   let encoded = encode(hello);
    |                 ^^^^^^

  warning: use of deprecated function `base64::decode`: Use Engine::decode
   --> src/bin/base64.rs:8:17
    |
  8 |   let decoded = decode(&encoded)?;
    |                 ^^^^^^

Also, this patch updates broken links on decode and encode.

🎉 Hi and welcome! Please read the text below and remove it - Thank you! 🎉

No worries if anything in these lists is unclear. Just submit the PR and ask away! 👍


Things to check before submitting a PR

  • the tests are passing locally with cargo xtask test all
  • commits are squashed into one and rebased to latest master
  • PR contains correct "fixes #ISSUE_ID" clause to autoclose the issue on PR merge
    • if issue does not exist consider creating it or remove the clause
  • non rendered items are in sorted order (links, reference, identifiers, Cargo.toml)
  • links to docs.rs have wildcard version https://docs.rs/tar/*/tar/struct.Entry.html
  • example has standard error handling
  • code identifiers in description are in hyperlinked backticks
[`Entry::unpack`]: https://docs.rs/tar/*/tar/struct.Entry.html#method.unpack

Things to do after submitting PR

  • check if CI is happy with your PR

Thank you for reading, you may now delete this text! Thank you! 😄

use anyhow::Result;
use std::str;
use base64::{encode, decode};
use base64::prelude::*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Prefer to show how to import the constant used rather than the whole prelude. https://docs.rs/base64/0.22.1/base64/prelude/index.html

Suggested change
use base64::prelude::*;
use base64::prelude::BASE64_STANDARD;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment! Make sense. Per test, import should be as follows:

use base64::prelude::{Engine as _, BASE64_STANDARD};

Let me update PR.

This patch addresses the following warnings:

  warning: use of deprecated function `base64::encode`: Use Engine::encode
   --> src/bin/base64.rs:3:14
    |
  3 | use base64::{encode, decode};
    |              ^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

  warning: use of deprecated function `base64::decode`: Use Engine::decode
   --> src/bin/base64.rs:3:22
    |
  3 | use base64::{encode, decode};
    |                      ^^^^^^

  warning: use of deprecated function `base64::encode`: Use Engine::encode
   --> src/bin/base64.rs:7:17
    |
  7 |   let encoded = encode(hello);
    |                 ^^^^^^

  warning: use of deprecated function `base64::decode`: Use Engine::decode
   --> src/bin/base64.rs:8:17
    |
  8 |   let decoded = decode(&encoded)?;
    |                 ^^^^^^

Also, this patch updates broken links on decode and encode.
Copy link
Contributor

@AndyGauge AndyGauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AndyGauge AndyGauge merged commit 279c5d9 into rust-lang-nursery:master Nov 24, 2025
1 of 3 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