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

Shows e-exprs inside container literals, delimited END #186

Merged
merged 5 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
410 changes: 207 additions & 203 deletions Cargo.lock
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🪧 This file is auto-generated and does not require review.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ flate2 = "1.0"
infer = "0.15.0"
# ion-rs version must be pinned because we are using experimental features
# See https://github.com/amazon-ion/ion-cli/issues/155
ion-rs = { version = "1.0.0-rc.10", features = ["experimental", "experimental-ion-hash"] }
ion-rs = { version = "1.0.0-rc.11", features = ["experimental", "experimental-ion-hash"] }
tempfile = "3.2.0"
ion-schema = "0.15.0"
lowcharts = "0.5.8"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/ion/commands/generate/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<'a> CodeGenerator<'a, JavaLanguage> {
}
}

impl<'a, L: Language + 'static> CodeGenerator<'a, L> {
impl<L: Language + 'static> CodeGenerator<'_, L> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🪧 Clippy suggestion.

/// A [tera] filter that converts given tera string value to [upper camel case].
/// Returns error if the given value is not a string.
///
Expand Down
11 changes: 9 additions & 2 deletions src/bin/ion/commands/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use ion_rs::ion_hash::IonHasher;
use ion_rs::*;
use sha2::{Sha256, Sha512};
use sha3::{Sha3_256, Sha3_512};
use std::fmt;
use std::io::Write;

// Macro to eliminate repetitive code for each hash algorithm.
Expand Down Expand Up @@ -109,8 +110,14 @@ impl IonCliCommand for HashCommand {
for elem in reader.elements() {
let elem = elem?;
let digest = hasher.hash_it(&elem)?;
let digest_string: String =
digest.iter().map(|b| format!("{:02x?}", b)).collect();
let digest_string = digest.iter().fold(
String::with_capacity(digest.len() * 2),
|mut string, byte| {
use fmt::Write;
write!(&mut string, "{:02x}", byte).expect("infallible");
string
},
);
Comment on lines -112 to +120
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🪧 Clippy suggestion.

output.write_all(digest_string.as_bytes())?;
output.write_all("\n".as_bytes())?;
}
Expand Down
Loading
Loading