Skip to content

Commit 550dbe2

Browse files
committed
update packages
1 parent 845198d commit 550dbe2

File tree

3 files changed

+94
-141
lines changed

3 files changed

+94
-141
lines changed

Cargo.lock

Lines changed: 87 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
2-
name = "base64"
3-
version = "0.1.0"
2+
name = "base64-rust"
3+
version = "0.1.1"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
base64 = "0.13.1"
10-
clap = "4.0.29"
9+
base64 = "0.22.1"
10+
clap = "4.5.20"

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::io::{Read, Write};
22

3+
use base64::{prelude::BASE64_STANDARD, Engine};
34
use clap::{Arg, ArgAction, Command};
45

56
fn main() {
@@ -77,7 +78,7 @@ fn main() {
7778
}
7879

7980
fn encode_base64<T: AsRef<[u8]>>(input: T, output_option: Option<&str>) {
80-
let b64_str = base64::encode(input);
81+
let b64_str = BASE64_STANDARD.encode(input);
8182
if let Some(filename) = output_option {
8283
// write to file
8384
write_to_file(filename, b64_str.as_bytes());
@@ -88,7 +89,7 @@ fn encode_base64<T: AsRef<[u8]>>(input: T, output_option: Option<&str>) {
8889
}
8990

9091
fn decode_base64<T: AsRef<[u8]>>(input: T, output_option: Option<&str>) {
91-
match base64::decode(input) {
92+
match BASE64_STANDARD.decode(input) {
9293
Ok(bytes) => {
9394
if let Some(filename) = output_option {
9495
// write to file

0 commit comments

Comments
 (0)