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
8 changes: 4 additions & 4 deletions cargo-typify/tests/outputs/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub mod builder {
{
self.veggie_like = value
.try_into()
.map_err(|e| format!("error converting supplied value for veggie_like: {}", e));
.map_err(|e| format!("error converting supplied value for veggie_like: {e}"));
self
}
pub fn veggie_name<T>(mut self, value: T) -> Self
Expand All @@ -248,7 +248,7 @@ pub mod builder {
{
self.veggie_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for veggie_name: {}", e));
.map_err(|e| format!("error converting supplied value for veggie_name: {e}"));
self
}
}
Expand Down Expand Up @@ -291,7 +291,7 @@ pub mod builder {
{
self.fruits = value
.try_into()
.map_err(|e| format!("error converting supplied value for fruits: {}", e));
.map_err(|e| format!("error converting supplied value for fruits: {e}"));
self
}
pub fn vegetables<T>(mut self, value: T) -> Self
Expand All @@ -301,7 +301,7 @@ pub mod builder {
{
self.vegetables = value
.try_into()
.map_err(|e| format!("error converting supplied value for vegetables: {}", e));
.map_err(|e| format!("error converting supplied value for vegetables: {e}"));
self
}
}
Expand Down
8 changes: 4 additions & 4 deletions cargo-typify/tests/outputs/custom_btree_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub mod builder {
{
self.veggie_like = value
.try_into()
.map_err(|e| format!("error converting supplied value for veggie_like: {}", e));
.map_err(|e| format!("error converting supplied value for veggie_like: {e}"));
self
}
pub fn veggie_name<T>(mut self, value: T) -> Self
Expand All @@ -249,7 +249,7 @@ pub mod builder {
{
self.veggie_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for veggie_name: {}", e));
.map_err(|e| format!("error converting supplied value for veggie_name: {e}"));
self
}
}
Expand Down Expand Up @@ -292,7 +292,7 @@ pub mod builder {
{
self.fruits = value
.try_into()
.map_err(|e| format!("error converting supplied value for fruits: {}", e));
.map_err(|e| format!("error converting supplied value for fruits: {e}"));
self
}
pub fn vegetables<T>(mut self, value: T) -> Self
Expand All @@ -302,7 +302,7 @@ pub mod builder {
{
self.vegetables = value
.try_into()
.map_err(|e| format!("error converting supplied value for vegetables: {}", e));
.map_err(|e| format!("error converting supplied value for vegetables: {e}"));
self
}
}
Expand Down
4 changes: 2 additions & 2 deletions typify-impl/src/type_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ impl TypeEntry {
prop_doc.push(prop.description.as_ref().map(|d| quote! { #[doc = #d] }));
prop_name.push(format_ident!("{}", prop.name));
prop_error.push(format!(
"error converting supplied value for {}: {{}}",
"error converting supplied value for {}: {{e}}",
prop.name,
));

Expand Down Expand Up @@ -1311,7 +1311,7 @@ impl TypeEntry {
T::Error: ::std::fmt::Display,
{
self.#prop_name = value.try_into()
.map_err(|e| format!(#prop_error, e));
.map_err(|e| format!(#prop_error));
self
}
)*
Expand Down
10 changes: 5 additions & 5 deletions typify-impl/tests/generator.out
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ mod types {
{
self.ok = value
.try_into()
.map_err(|e| format!("error converting supplied value for ok: {}", e));
.map_err(|e| format!("error converting supplied value for ok: {e}"));
self
}
}
Expand Down Expand Up @@ -294,7 +294,7 @@ mod types {
{
self.value1 = value
.try_into()
.map_err(|e| format!("error converting supplied value for value1: {}", e));
.map_err(|e| format!("error converting supplied value for value1: {e}"));
self
}
pub fn value2<T>(mut self, value: T) -> Self
Expand All @@ -304,7 +304,7 @@ mod types {
{
self.value2 = value
.try_into()
.map_err(|e| format!("error converting supplied value for value2: {}", e));
.map_err(|e| format!("error converting supplied value for value2: {e}"));
self
}
}
Expand Down Expand Up @@ -348,7 +348,7 @@ mod types {
{
self.a = value
.try_into()
.map_err(|e| format!("error converting supplied value for a: {}", e));
.map_err(|e| format!("error converting supplied value for a: {e}"));
self
}
pub fn b<T>(mut self, value: T) -> Self
Expand All @@ -358,7 +358,7 @@ mod types {
{
self.b = value
.try_into()
.map_err(|e| format!("error converting supplied value for b: {}", e));
.map_err(|e| format!("error converting supplied value for b: {e}"));
self
}
}
Expand Down
4 changes: 2 additions & 2 deletions typify/tests/schemas/deny-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub mod builder {
{
self.where_not = value
.try_into()
.map_err(|e| format!("error converting supplied value for where_not: {}", e));
.map_err(|e| format!("error converting supplied value for where_not: {e}"));
self
}
pub fn why_not<T>(mut self, value: T) -> Self
Expand All @@ -219,7 +219,7 @@ pub mod builder {
{
self.why_not = value
.try_into()
.map_err(|e| format!("error converting supplied value for why_not: {}", e));
.map_err(|e| format!("error converting supplied value for why_not: {e}"));
self
}
}
Expand Down
2 changes: 1 addition & 1 deletion typify/tests/schemas/extraneous-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub mod builder {
{
self.letter = value
.try_into()
.map_err(|e| format!("error converting supplied value for letter: {}", e));
.map_err(|e| format!("error converting supplied value for letter: {e}"));
self
}
}
Expand Down
36 changes: 18 additions & 18 deletions typify/tests/schemas/merged-schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ pub mod builder {
{
self.bar = value
.try_into()
.map_err(|e| format!("error converting supplied value for bar: {}", e));
.map_err(|e| format!("error converting supplied value for bar: {e}"));
self
}
}
Expand Down Expand Up @@ -1591,7 +1591,7 @@ pub mod builder {
{
self.this = value
.try_into()
.map_err(|e| format!("error converting supplied value for this: {}", e));
.map_err(|e| format!("error converting supplied value for this: {e}"));
self
}
}
Expand Down Expand Up @@ -1631,7 +1631,7 @@ pub mod builder {
{
self.x = value
.try_into()
.map_err(|e| format!("error converting supplied value for x: {}", e));
.map_err(|e| format!("error converting supplied value for x: {e}"));
self
}
pub fn y<T>(mut self, value: T) -> Self
Expand All @@ -1641,7 +1641,7 @@ pub mod builder {
{
self.y = value
.try_into()
.map_err(|e| format!("error converting supplied value for y: {}", e));
.map_err(|e| format!("error converting supplied value for y: {e}"));
self
}
}
Expand Down Expand Up @@ -1686,7 +1686,7 @@ pub mod builder {
{
self.result = value
.try_into()
.map_err(|e| format!("error converting supplied value for result: {}", e));
.map_err(|e| format!("error converting supplied value for result: {e}"));
self
}
}
Expand Down Expand Up @@ -1728,7 +1728,7 @@ pub mod builder {
{
self.msg = value
.try_into()
.map_err(|e| format!("error converting supplied value for msg: {}", e));
.map_err(|e| format!("error converting supplied value for msg: {e}"));
self
}
pub fn result<T>(mut self, value: T) -> Self
Expand All @@ -1738,7 +1738,7 @@ pub mod builder {
{
self.result = value
.try_into()
.map_err(|e| format!("error converting supplied value for result: {}", e));
.map_err(|e| format!("error converting supplied value for result: {e}"));
self
}
}
Expand Down Expand Up @@ -1782,7 +1782,7 @@ pub mod builder {
{
self.msg = value
.try_into()
.map_err(|e| format!("error converting supplied value for msg: {}", e));
.map_err(|e| format!("error converting supplied value for msg: {e}"));
self
}
pub fn result<T>(mut self, value: T) -> Self
Expand All @@ -1792,7 +1792,7 @@ pub mod builder {
{
self.result = value
.try_into()
.map_err(|e| format!("error converting supplied value for result: {}", e));
.map_err(|e| format!("error converting supplied value for result: {e}"));
self
}
}
Expand Down Expand Up @@ -1860,7 +1860,7 @@ pub mod builder {
{
self.bar = value
.try_into()
.map_err(|e| format!("error converting supplied value for bar: {}", e));
.map_err(|e| format!("error converting supplied value for bar: {e}"));
self
}
pub fn baz<T>(mut self, value: T) -> Self
Expand All @@ -1870,7 +1870,7 @@ pub mod builder {
{
self.baz = value
.try_into()
.map_err(|e| format!("error converting supplied value for baz: {}", e));
.map_err(|e| format!("error converting supplied value for baz: {e}"));
self
}
}
Expand Down Expand Up @@ -1912,7 +1912,7 @@ pub mod builder {
{
self.suspended_by = value
.try_into()
.map_err(|e| format!("error converting supplied value for suspended_by: {}", e));
.map_err(|e| format!("error converting supplied value for suspended_by: {e}"));
self
}
}
Expand Down Expand Up @@ -1955,7 +1955,7 @@ pub mod builder {
{
self.suspended_by = value
.try_into()
.map_err(|e| format!("error converting supplied value for suspended_by: {}", e));
.map_err(|e| format!("error converting supplied value for suspended_by: {e}"));
self
}
}
Expand Down Expand Up @@ -1998,7 +1998,7 @@ pub mod builder {
{
self.email = value
.try_into()
.map_err(|e| format!("error converting supplied value for email: {}", e));
.map_err(|e| format!("error converting supplied value for email: {e}"));
self
}
}
Expand Down Expand Up @@ -2041,7 +2041,7 @@ pub mod builder {
{
self.email = value
.try_into()
.map_err(|e| format!("error converting supplied value for email: {}", e));
.map_err(|e| format!("error converting supplied value for email: {e}"));
self
}
}
Expand Down Expand Up @@ -2081,7 +2081,7 @@ pub mod builder {
{
self.a = value
.try_into()
.map_err(|e| format!("error converting supplied value for a: {}", e));
.map_err(|e| format!("error converting supplied value for a: {e}"));
self
}
}
Expand Down Expand Up @@ -2115,7 +2115,7 @@ pub mod builder {
{
self.tag = value
.try_into()
.map_err(|e| format!("error converting supplied value for tag: {}", e));
.map_err(|e| format!("error converting supplied value for tag: {e}"));
self
}
}
Expand Down Expand Up @@ -2154,7 +2154,7 @@ pub mod builder {
{
self.action = value
.try_into()
.map_err(|e| format!("error converting supplied value for action: {}", e));
.map_err(|e| format!("error converting supplied value for action: {e}"));
self
}
}
Expand Down
14 changes: 7 additions & 7 deletions typify/tests/schemas/more_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub mod builder {
{
self.foo = value
.try_into()
.map_err(|e| format!("error converting supplied value for foo: {}", e));
.map_err(|e| format!("error converting supplied value for foo: {e}"));
self
}
}
Expand Down Expand Up @@ -248,7 +248,7 @@ pub mod builder {
{
self.foo = value
.try_into()
.map_err(|e| format!("error converting supplied value for foo: {}", e));
.map_err(|e| format!("error converting supplied value for foo: {e}"));
self
}
}
Expand Down Expand Up @@ -289,7 +289,7 @@ pub mod builder {
{
self.foo = value
.try_into()
.map_err(|e| format!("error converting supplied value for foo: {}", e));
.map_err(|e| format!("error converting supplied value for foo: {e}"));
self
}
pub fn extra<T>(mut self, value: T) -> Self
Expand All @@ -301,7 +301,7 @@ pub mod builder {
{
self.extra = value
.try_into()
.map_err(|e| format!("error converting supplied value for extra: {}", e));
.map_err(|e| format!("error converting supplied value for extra: {e}"));
self
}
}
Expand Down Expand Up @@ -348,7 +348,7 @@ pub mod builder {
{
self.foo = value
.try_into()
.map_err(|e| format!("error converting supplied value for foo: {}", e));
.map_err(|e| format!("error converting supplied value for foo: {e}"));
self
}
pub fn extra<T>(mut self, value: T) -> Self
Expand All @@ -360,7 +360,7 @@ pub mod builder {
{
self.extra = value
.try_into()
.map_err(|e| format!("error converting supplied value for extra: {}", e));
.map_err(|e| format!("error converting supplied value for extra: {e}"));
self
}
}
Expand Down Expand Up @@ -402,7 +402,7 @@ pub mod builder {
{
self.foo = value
.try_into()
.map_err(|e| format!("error converting supplied value for foo: {}", e));
.map_err(|e| format!("error converting supplied value for foo: {e}"));
self
}
}
Expand Down
2 changes: 1 addition & 1 deletion typify/tests/schemas/noisy-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub mod builder {
{
self.ok = value
.try_into()
.map_err(|e| format!("error converting supplied value for ok: {}", e));
.map_err(|e| format!("error converting supplied value for ok: {e}"));
self
}
}
Expand Down
Loading