Skip to content
Open
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
2 changes: 1 addition & 1 deletion json_typegen_shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ thiserror = "1.0"
linked-hash-map = "0.5.4"
syn = { version = "0.11", features = ["full", "parsing"], optional = true }
synom = { version = "0.11.3", optional = true }
indicatif = { version = "0.16.2", optional = true }
indicatif = { version = "0.18.0", optional = true }
sqlparser = "0.36.1"

[dev-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions json_typegen_shared/src/hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@ impl<'a> Hints<'a> {
}

/// ([/a/b, /a/c, /d/e], "a") -> [/b, /c]
pub fn step_field(&self, name: &str) -> Hints {
pub fn step_field(&self, name: &str) -> Hints<'_> {
self.step(|first| first == "-" || first == name)
}

/// [/1/b, /a/c, /-/e] -> [/b, /c, /e]
pub fn step_any(&self) -> Hints {
pub fn step_any(&self) -> Hints<'_> {
self.step(|_first| true)
}

/// [/1/b, /a/c, /-/e] -> [/b, /e]
pub fn step_array(&self) -> Hints {
pub fn step_array(&self) -> Hints<'_> {
self.step(is_index)
}

/// ([/2/b, /a/c, /-/e, /3/d], 3) -> [/e, /d]
pub fn step_index(&self, index: usize) -> Hints {
pub fn step_index(&self, index: usize) -> Hints<'_> {
let i_str = &index.to_string();
self.step(|first| first == "-" || first == i_str)
}

fn step<F: Fn(&str) -> bool>(&self, pred: F) -> Hints {
fn step<F: Fn(&str) -> bool>(&self, pred: F) -> Hints<'_> {
let mut filtered = Vec::new();
let mut applicable = Vec::new();

Expand Down
2 changes: 1 addition & 1 deletion json_typegen_shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fn handle_pub_in_name<'a>(name: &'a str, options: &mut Options) -> &'a str {
name
}

fn infer_source_type(s: &str) -> SampleSource {
fn infer_source_type(s: &str) -> SampleSource<'_> {
let s = s.trim();
if s.starts_with('{') || s.starts_with('[') {
return SampleSource::Text(s);
Expand Down
4 changes: 2 additions & 2 deletions json_typegen_shared/src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ impl FileWithProgress {
let len = file.metadata()?.len();
Ok(FileWithProgress {
file,
progress: ProgressBar::new(len).with_style(ProgressStyle::default_bar().template(
progress: ProgressBar::new(len).with_style(ProgressStyle::with_template(
"[{elapsed_precise}] {bar:40.cyan/blue} {bytes}/{total_bytes} Processing file...",
)),
).unwrap()),
})
}
}
Expand Down