Skip to content

Commit 6d608aa

Browse files
committed
Update rust.
1 parent fc878ff commit 6d608aa

11 files changed

Lines changed: 18 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#### ⚙️ Internal
66

7+
- Updated to Rust v1.88.
78
- Updated dependencies.
89

910
## 0.18.9

crates/macros/src/common/container.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Container<'_> {
2323
let mut settings = vec![];
2424

2525
let format_alias = |ts: TokenStream| {
26-
format!("{}", ts)
26+
format!("{ts}")
2727
.replace(" < ", "<")
2828
.replace("< ", "<")
2929
.replace(" <", "<")

crates/macros/src/config/field_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl FieldValue<'_> {
3737
other => quote! { Some(#other) },
3838
},
3939
invalid => {
40-
let info = format!("{:?}", invalid);
40+
let info = format!("{invalid:?}");
4141

4242
panic!(
4343
"Unsupported default value ({info}). May only provide literals, primitives, arrays, or tuples."

crates/macros/src/config_enum/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub fn macro_impl(item: TokenStream) -> TokenStream {
9494
let value = value.as_str();
9595
}
9696
} else {
97-
panic!("Unknown `before_parse` value {}", parser);
97+
panic!("Unknown `before_parse` value {parser}");
9898
}
9999
} else {
100100
quote! {}

crates/schematic/src/config/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ impl Display for Path {
7272
for segment in &self.segments {
7373
match segment {
7474
PathSegment::Index(index) => {
75-
write!(formatter, "[{}]", index)?;
75+
write!(formatter, "[{index}]")?;
7676
}
7777
PathSegment::Key(key) | PathSegment::Variant(key) => {
78-
write!(formatter, "{}{}", separator, key)?;
78+
write!(formatter, "{separator}{key}")?;
7979
}
8080
PathSegment::Unknown => {
81-
write!(formatter, "{}?", separator)?;
81+
write!(formatter, "{separator}?")?;
8282
}
8383
}
8484

crates/schematic/src/schema/renderers/typescript.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl TypeScriptRenderer {
230230
self.render_schema(&variant.schema)?
231231
)
232232
} else {
233-
format!("{}{},", indent, name)
233+
format!("{indent}{name},")
234234
};
235235

236236
let mut tags = vec![];
@@ -297,13 +297,13 @@ impl TypeScriptRenderer {
297297

298298
for line in lines {
299299
if line.is_empty() {
300-
out.push(format!("{} *", indent));
300+
out.push(format!("{indent} *"));
301301
} else {
302302
out.push(format!("{} * {}", indent, line.trim()));
303303
}
304304
}
305305

306-
out.push(format!("{} */", indent));
306+
out.push(format!("{indent} */"));
307307

308308
format!("{}\n{}", out.join("\n"), value)
309309
}
@@ -407,7 +407,7 @@ impl SchemaRenderer<String> for TypeScriptRenderer {
407407
continue;
408408
}
409409

410-
let mut row = format!("{}{}", indent, name);
410+
let mut row = format!("{indent}{name}");
411411

412412
if field.optional
413413
|| matches!(

crates/schematic/src/schema/renderers/yaml_template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl SchemaRenderer<String> for YamlTemplateRenderer {
101101
key = "example".into();
102102
}
103103

104-
Ok(format!("{}{key}:\n{value}", item_indent))
104+
Ok(format!("{item_indent}{key}:\n{value}"))
105105
}
106106

107107
fn render_reference(&mut self, reference: &str, _schema: &Schema) -> RenderResult<String> {

crates/schematic/tests/merge_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct MergeNormal {
1111
}
1212

1313
fn merge_string<C>(prev: String, next: String, _: &C) -> MergeResult<String> {
14-
Ok(Some(format!("{}-{}", prev, next)))
14+
Ok(Some(format!("{prev}-{next}")))
1515
}
1616

1717
#[derive(Config)]

crates/schematic/tests/partialize_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use std::fmt::Debug;
1010
fn create_diff<T: Schematic>() -> String {
1111
let mut schema = SchemaBuilder::build_root::<T>();
1212

13-
let original = format!("{:#?}", schema);
13+
let original = format!("{schema:#?}");
1414

1515
partialize_schema(&mut schema, true);
1616

17-
let partial = format!("{:#?}", schema);
17+
let partial = format!("{schema:#?}");
1818

1919
// println!("ORIGINAL:\n{}\n\n", original);
2020
// println!("PARTIAL:\n{}\n\n", partial);
@@ -28,7 +28,7 @@ fn create_diff<T: Schematic>() -> String {
2828
ChangeTag::Equal => "⬛️",
2929
};
3030

31-
diff.push_str(&format!("{}{}", sign, change));
31+
diff.push_str(&format!("{sign}{change}"));
3232
}
3333

3434
diff

crates/schematic/tests/url_sources_test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ pub struct Config {
1313

1414
fn get_url(path: &str) -> String {
1515
format!(
16-
"https://raw.githubusercontent.com/moonrepo/schematic/master/crates/schematic/tests/__fixtures__/{}",
17-
path
16+
"https://raw.githubusercontent.com/moonrepo/schematic/master/crates/schematic/tests/__fixtures__/{path}"
1817
)
1918
}
2019

0 commit comments

Comments
 (0)