Skip to content

Commit

Permalink
formatting cleanup, set ion_rs dep to v1.0.0-rc.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zslayton committed Jun 3, 2024
1 parent 30551a0 commit b2a4525
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 149 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clap = { version = "4.0.17", features = ["cargo"] }
colored = "2.0.0"
flate2 = "1.0"
infer = "0.15.0"
ion-rs = { version = "1.0.0-rc.4", features = ["experimental"] }
ion-rs = { version = "1.0.0-rc.5", features = ["experimental"] }
tempfile = "3.2.0"
ion-schema = "0.10.0"
serde = { version = "1.0.163", features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions src/bin/ion/commands/beta/generate/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::Serialize;
use std::fmt::{Display, Formatter};

/// Represents a field that will be added to generated data model.
/// This will be used by the template engine to fill properties of a struct/classs.
/// This will be used by the template engine to fill properties of a struct/class.
#[derive(Serialize)]
pub struct Field {
pub(crate) name: String,
Expand Down Expand Up @@ -76,7 +76,7 @@ impl Language for JavaLanguage {
Blob | Clob => "byte[]",
SchemaDefined(name) => name,
}
.to_string()
.to_string()
}

fn target_type_as_sequence(target_type: &str) -> String {
Expand Down Expand Up @@ -129,7 +129,7 @@ impl Language for RustLanguage {
Blob | Clob => "Vec<u8>",
SchemaDefined(name) => name,
}
.to_string()
.to_string()
}

fn target_type_as_sequence(target_type: &str) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/ion/commands/beta/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl<'a, 'b> IonInspector<'a, 'b> {
/// inspected; if the e-expression that produced the value was not beyond the limit,
/// none of the ephemeral values it produces are either.
fn is_past_limit<T: HasRange>(&mut self, maybe_item: &Option<T>) -> bool {
let limit = self.bytes_to_skip + self.limit_bytes;
let limit = self.bytes_to_skip.saturating_add(self.limit_bytes);
maybe_item.as_ref().map(|item| item.range().start >= limit).unwrap_or(false)
}

Expand Down
3 changes: 2 additions & 1 deletion src/bin/ion/commands/beta/to/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::fs::File;
use std::io::{stdin, stdout, BufWriter, Write};
use std::str::FromStr;
use ion_rs::*;
use zstd::zstd_safe::WriteBuf;

pub struct ToJsonCommand;

Expand Down Expand Up @@ -102,7 +103,7 @@ fn to_json_value(value: LazyValue<AnyEncoding>) -> Result<JsonValue> {
String(s) => JsonValue::String(s.text().to_owned()),
Blob(b) | Clob(b) => {
use base64::{engine::general_purpose as base64_encoder, Engine as _};
let base64_text = base64_encoder::STANDARD.encode(b.as_ref());
let base64_text = base64_encoder::STANDARD.encode(b.as_slice());
JsonValue::String(base64_text)
}
SExp(s) => to_json_array(s.iter())?,
Expand Down
Loading

0 comments on commit b2a4525

Please sign in to comment.