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

Upgrade to ion_rs dependency to v1.0.0-rc.5 #113

Merged
merged 13 commits into from
Jun 3, 2024
69 changes: 38 additions & 31 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ 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.2", features = ["experimental"]}
memmap = "0.7.0"
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"] }
serde_json = { version = "1.0.81", features = [ "arbitrary_precision", "preserve_order" ] }
serde_json = { version = "1.0.81", features = ["arbitrary_precision", "preserve_order"] }
base64 = "0.21.1"
tera = { version = "1.18.1", optional = true }
tera = { version = "1.18.1", optional = true }
convert_case = { version = "0.6.0", optional = true }
matches = "0.1.10"
thiserror = "1.0.50"
zstd = "0.13.0"
termcolor = "1.4.1"

[target.'cfg(not(target_os = "windows"))'.dependencies]
pager = "0.16.1"
Expand Down
14 changes: 4 additions & 10 deletions src/bin/ion/commands/beta/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,23 @@ impl IonCliCommand for CountCommand {
for input_file in input_file_iter {
let file = File::open(input_file)
.with_context(|| format!("Could not open file '{}'", input_file))?;
let mut reader = ReaderBuilder::new().build(file)?;
let mut reader = Reader::new(AnyEncoding, file)?;
print_top_level_value_count(&mut reader)?;
}
} else {
let input: StdinLock = stdin().lock();
let buf_reader = BufReader::new(input);
let mut reader = ReaderBuilder::new().build(buf_reader)?;
let mut reader = Reader::new(AnyEncoding, buf_reader)?;
print_top_level_value_count(&mut reader)?;
};

Ok(())
}
}

fn print_top_level_value_count(reader: &mut Reader) -> Result<()> {
fn print_top_level_value_count<I: IonInput>(reader: &mut Reader<AnyEncoding, I>) -> Result<()> {
let mut count: usize = 0;
loop {
let item = reader
.next()
.with_context(|| "could not count values in Ion stream")?;
if item == StreamItem::Nothing {
break;
}
while let Some(_) = reader.next()? {
count += 1;
}
println!("{}", count);
Expand Down
2 changes: 1 addition & 1 deletion 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 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 @@ -66,7 +66,7 @@
/// e.g.
/// Rust field name case -> [Case::Snake]
/// Java field name case -> [Case::Camel]
fn field_name_case() -> Case;

Check warning on line 69 in src/bin/ion/commands/beta/generate/utils.rs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

associated function `field_name_case` is never used

/// Returns true if the type name specified is provided by the target language implementation
fn is_built_in_type(name: &str) -> bool;
Expand Down
Loading
Loading