More uninlined_format_args fixes (#19396)
# Objective There are several uninlined format args (seems to be in more formatting macros and in more crates) that are not detected on stable, but are on nightly. ## Solution Fix them.
This commit is contained in:
parent
3aaadd9b54
commit
a266e7e642
@ -177,8 +177,8 @@ impl Srgba {
|
|||||||
pub fn to_hex(&self) -> String {
|
pub fn to_hex(&self) -> String {
|
||||||
let [r, g, b, a] = self.to_u8_array();
|
let [r, g, b, a] = self.to_u8_array();
|
||||||
match a {
|
match a {
|
||||||
255 => format!("#{:02X}{:02X}{:02X}", r, g, b),
|
255 => format!("#{r:02X}{g:02X}{b:02X}"),
|
||||||
_ => format!("#{:02X}{:02X}{:02X}{:02X}", r, g, b, a),
|
_ => format!("#{r:02X}{g:02X}{b:02X}{a:02X}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ pub fn derive_event(input: TokenStream) -> TokenStream {
|
|||||||
traversal = meta.value()?.parse()?;
|
traversal = meta.value()?.parse()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Some(ident) => Err(meta.error(format!("unsupported attribute: {}", ident))),
|
Some(ident) => Err(meta.error(format!("unsupported attribute: {ident}"))),
|
||||||
None => Err(meta.error("expected identifier")),
|
None => Err(meta.error("expected identifier")),
|
||||||
}) {
|
}) {
|
||||||
return e.to_compile_error().into();
|
return e.to_compile_error().into();
|
||||||
|
@ -242,7 +242,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|f| quote! { #f })
|
.map(|f| quote! { #f })
|
||||||
.unwrap_or_else(|| quote! { #i });
|
.unwrap_or_else(|| quote! { #i });
|
||||||
field_names.push(format!("::{}", field_value));
|
field_names.push(format!("::{field_value}"));
|
||||||
fields.push(field_value);
|
fields.push(field_value);
|
||||||
field_types.push(&field.ty);
|
field_types.push(&field.ty);
|
||||||
let mut field_message = None;
|
let mut field_message = None;
|
||||||
|
@ -1545,22 +1545,22 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn entity_debug() {
|
fn entity_debug() {
|
||||||
let entity = Entity::from_raw(EntityRow::new(NonMaxU32::new(42).unwrap()));
|
let entity = Entity::from_raw(EntityRow::new(NonMaxU32::new(42).unwrap()));
|
||||||
let string = format!("{:?}", entity);
|
let string = format!("{entity:?}");
|
||||||
assert_eq!(string, "42v0#4294967253");
|
assert_eq!(string, "42v0#4294967253");
|
||||||
|
|
||||||
let entity = Entity::PLACEHOLDER;
|
let entity = Entity::PLACEHOLDER;
|
||||||
let string = format!("{:?}", entity);
|
let string = format!("{entity:?}");
|
||||||
assert_eq!(string, "PLACEHOLDER");
|
assert_eq!(string, "PLACEHOLDER");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn entity_display() {
|
fn entity_display() {
|
||||||
let entity = Entity::from_raw(EntityRow::new(NonMaxU32::new(42).unwrap()));
|
let entity = Entity::from_raw(EntityRow::new(NonMaxU32::new(42).unwrap()));
|
||||||
let string = format!("{}", entity);
|
let string = format!("{entity}");
|
||||||
assert_eq!(string, "42v0");
|
assert_eq!(string, "42v0");
|
||||||
|
|
||||||
let entity = Entity::PLACEHOLDER;
|
let entity = Entity::PLACEHOLDER;
|
||||||
let string = format!("{}", entity);
|
let string = format!("{entity}");
|
||||||
assert_eq!(string, "PLACEHOLDER");
|
assert_eq!(string, "PLACEHOLDER");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ impl BevyError {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writeln!(f, "{}", line)?;
|
writeln!(f, "{line}")?;
|
||||||
}
|
}
|
||||||
if !full_backtrace {
|
if !full_backtrace {
|
||||||
if std::thread::panicking() {
|
if std::thread::panicking() {
|
||||||
|
@ -39,14 +39,14 @@ impl Display for ErrorContext {
|
|||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::System { name, .. } => {
|
Self::System { name, .. } => {
|
||||||
write!(f, "System `{}` failed", name)
|
write!(f, "System `{name}` failed")
|
||||||
}
|
}
|
||||||
Self::Command { name } => write!(f, "Command `{}` failed", name),
|
Self::Command { name } => write!(f, "Command `{name}` failed"),
|
||||||
Self::Observer { name, .. } => {
|
Self::Observer { name, .. } => {
|
||||||
write!(f, "Observer `{}` failed", name)
|
write!(f, "Observer `{name}` failed")
|
||||||
}
|
}
|
||||||
Self::RunCondition { name, .. } => {
|
Self::RunCondition { name, .. } => {
|
||||||
write!(f, "Run condition `{}` failed", name)
|
write!(f, "Run condition `{name}` failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ pub fn validate_parent_has_component<C: Component>(
|
|||||||
caller.map(|c| format!("{c}: ")).unwrap_or_default(),
|
caller.map(|c| format!("{c}: ")).unwrap_or_default(),
|
||||||
ty_name = ShortName::of::<C>(),
|
ty_name = ShortName::of::<C>(),
|
||||||
name = name.map_or_else(
|
name = name.map_or_else(
|
||||||
|| format!("Entity {}", entity),
|
|| format!("Entity {entity}"),
|
||||||
|s| format!("The {s} entity")
|
|s| format!("The {s} entity")
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -362,7 +362,7 @@ mod tests {
|
|||||||
#[expect(clippy::print_stdout, reason = "std and println are allowed in tests")]
|
#[expect(clippy::print_stdout, reason = "std and println are allowed in tests")]
|
||||||
fn single_and_populated_skipped_and_run() {
|
fn single_and_populated_skipped_and_run() {
|
||||||
for executor in EXECUTORS {
|
for executor in EXECUTORS {
|
||||||
std::println!("Testing executor: {:?}", executor);
|
std::println!("Testing executor: {executor:?}");
|
||||||
|
|
||||||
let mut world = World::new();
|
let mut world = World::new();
|
||||||
world.init_resource::<TestState>();
|
world.init_resource::<TestState>();
|
||||||
|
@ -125,7 +125,7 @@ impl core::fmt::Debug for Stepping {
|
|||||||
if self.action != Action::RunAll {
|
if self.action != Action::RunAll {
|
||||||
let Cursor { schedule, system } = self.cursor;
|
let Cursor { schedule, system } = self.cursor;
|
||||||
match self.schedule_order.get(schedule) {
|
match self.schedule_order.get(schedule) {
|
||||||
Some(label) => write!(f, "cursor: {:?}[{}], ", label, system)?,
|
Some(label) => write!(f, "cursor: {label:?}[{system}], ")?,
|
||||||
None => write!(f, "cursor: None, ")?,
|
None => write!(f, "cursor: None, ")?,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ impl World {
|
|||||||
&mut self,
|
&mut self,
|
||||||
id: ComponentId,
|
id: ComponentId,
|
||||||
) -> Option<&mut ComponentHooks> {
|
) -> Option<&mut ComponentHooks> {
|
||||||
assert!(!self.archetypes.archetypes.iter().any(|a| a.contains(id)), "Components hooks cannot be modified if the component already exists in an archetype, use register_component if the component with id {:?} may already be in use", id);
|
assert!(!self.archetypes.archetypes.iter().any(|a| a.contains(id)), "Components hooks cannot be modified if the component already exists in an archetype, use register_component if the component with id {id:?} may already be in use");
|
||||||
self.components.get_hooks_mut(id)
|
self.components.get_hooks_mut(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1788,9 +1788,7 @@ mod tests {
|
|||||||
for (i, (a, b)) in cubic_curve.iter().zip(rational_curve.iter()).enumerate() {
|
for (i, (a, b)) in cubic_curve.iter().zip(rational_curve.iter()).enumerate() {
|
||||||
assert!(
|
assert!(
|
||||||
a.distance(*b) < EPSILON,
|
a.distance(*b) < EPSILON,
|
||||||
"Mismatch at {name} value {i}. CubicCurve: {} Converted RationalCurve: {}",
|
"Mismatch at {name} value {i}. CubicCurve: {a} Converted RationalCurve: {b}",
|
||||||
a,
|
|
||||||
b
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ pub(crate) mod array {
|
|||||||
type Value = [T; N];
|
type Value = [T; N];
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
|
fn expecting(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||||
formatter.write_fmt(format_args!("an array of length {}", N))
|
formatter.write_fmt(format_args!("an array of length {N}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -186,8 +186,7 @@ impl DynamicArray {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::Array(_)),
|
matches!(represented_type, TypeInfo::Array(_)),
|
||||||
"expected TypeInfo::Array but received: {:?}",
|
"expected TypeInfo::Array but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ mod tests {
|
|||||||
fn should_debug_custom_attributes() {
|
fn should_debug_custom_attributes() {
|
||||||
let attributes = CustomAttributes::default().with_attribute("My awesome custom attribute!");
|
let attributes = CustomAttributes::default().with_attribute("My awesome custom attribute!");
|
||||||
|
|
||||||
let debug = format!("{:?}", attributes);
|
let debug = format!("{attributes:?}");
|
||||||
|
|
||||||
assert_eq!(r#"{"My awesome custom attribute!"}"#, debug);
|
assert_eq!(r#"{"My awesome custom attribute!"}"#, debug);
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ mod tests {
|
|||||||
|
|
||||||
let attributes = CustomAttributes::default().with_attribute(Foo { value: 42 });
|
let attributes = CustomAttributes::default().with_attribute(Foo { value: 42 });
|
||||||
|
|
||||||
let debug = format!("{:?}", attributes);
|
let debug = format!("{attributes:?}");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r#"{bevy_reflect::attributes::tests::Foo { value: 42 }}"#,
|
r#"{bevy_reflect::attributes::tests::Foo { value: 42 }}"#,
|
||||||
|
@ -114,8 +114,7 @@ impl DynamicEnum {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::Enum(_)),
|
matches!(represented_type, TypeInfo::Enum(_)),
|
||||||
"expected TypeInfo::Enum but received: {:?}",
|
"expected TypeInfo::Enum but received: {represented_type:?}",
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ fn full_path(
|
|||||||
container_type_path: &str,
|
container_type_path: &str,
|
||||||
) -> alloc::string::String {
|
) -> alloc::string::String {
|
||||||
match variant {
|
match variant {
|
||||||
Some(variant) => format!("{}::{}::{}", container_type_path, variant, field),
|
Some(variant) => format!("{container_type_path}::{variant}::{field}"),
|
||||||
None => format!("{}::{}", container_type_path, field),
|
None => format!("{container_type_path}::{field}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,7 +550,7 @@ mod tests {
|
|||||||
fn should_clone_dynamic_function() {
|
fn should_clone_dynamic_function() {
|
||||||
let hello = String::from("Hello");
|
let hello = String::from("Hello");
|
||||||
|
|
||||||
let greet = |name: &String| -> String { format!("{}, {}!", hello, name) };
|
let greet = |name: &String| -> String { format!("{hello}, {name}!") };
|
||||||
|
|
||||||
let greet = greet.into_function().with_name("greet");
|
let greet = greet.into_function().with_name("greet");
|
||||||
let clone = greet.clone();
|
let clone = greet.clone();
|
||||||
@ -771,18 +771,18 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn should_debug_dynamic_function() {
|
fn should_debug_dynamic_function() {
|
||||||
fn greet(name: &String) -> String {
|
fn greet(name: &String) -> String {
|
||||||
format!("Hello, {}!", name)
|
format!("Hello, {name}!")
|
||||||
}
|
}
|
||||||
|
|
||||||
let function = greet.into_function();
|
let function = greet.into_function();
|
||||||
let debug = format!("{:?}", function);
|
let debug = format!("{function:?}");
|
||||||
assert_eq!(debug, "DynamicFunction(fn bevy_reflect::func::dynamic_function::tests::should_debug_dynamic_function::greet(_: &alloc::string::String) -> alloc::string::String)");
|
assert_eq!(debug, "DynamicFunction(fn bevy_reflect::func::dynamic_function::tests::should_debug_dynamic_function::greet(_: &alloc::string::String) -> alloc::string::String)");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_debug_anonymous_dynamic_function() {
|
fn should_debug_anonymous_dynamic_function() {
|
||||||
let function = (|a: i32, b: i32| a + b).into_function();
|
let function = (|a: i32, b: i32| a + b).into_function();
|
||||||
let debug = format!("{:?}", function);
|
let debug = format!("{function:?}");
|
||||||
assert_eq!(debug, "DynamicFunction(fn _(_: i32, _: i32) -> i32)");
|
assert_eq!(debug, "DynamicFunction(fn _(_: i32, _: i32) -> i32)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,11 +792,11 @@ mod tests {
|
|||||||
a + b
|
a + b
|
||||||
}
|
}
|
||||||
|
|
||||||
let func = add::<i32>
|
let function = add::<i32>
|
||||||
.into_function()
|
.into_function()
|
||||||
.with_overload(add::<f32>)
|
.with_overload(add::<f32>)
|
||||||
.with_name("add");
|
.with_name("add");
|
||||||
let debug = format!("{:?}", func);
|
let debug = format!("{function:?}");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
debug,
|
debug,
|
||||||
"DynamicFunction(fn add{(_: i32, _: i32) -> i32, (_: f32, _: f32) -> f32})"
|
"DynamicFunction(fn add{(_: i32, _: i32) -> i32, (_: f32, _: f32) -> f32})"
|
||||||
|
@ -434,7 +434,7 @@ impl<'a> Debug for PrettyPrintFunctionInfo<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match (self.include_name, self.info.name()) {
|
match (self.include_name, self.info.name()) {
|
||||||
(true, Some(name)) => write!(f, "{}", name)?,
|
(true, Some(name)) => write!(f, "{name}")?,
|
||||||
(true, None) => write!(f, "_")?,
|
(true, None) => write!(f, "_")?,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
@ -509,7 +509,7 @@ impl<'a> Debug for PrettyPrintSignatureInfo<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match (self.include_name, self.info.name()) {
|
match (self.include_name, self.info.name()) {
|
||||||
(true, Some(name)) => write!(f, "{}", name)?,
|
(true, Some(name)) => write!(f, "{name}")?,
|
||||||
(true, None) => write!(f, "_")?,
|
(true, None) => write!(f, "_")?,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
@ -520,7 +520,7 @@ mod tests {
|
|||||||
let mut registry = FunctionRegistry::default();
|
let mut registry = FunctionRegistry::default();
|
||||||
registry.register_with_name("foo", foo).unwrap();
|
registry.register_with_name("foo", foo).unwrap();
|
||||||
|
|
||||||
let debug = format!("{:?}", registry);
|
let debug = format!("{registry:?}");
|
||||||
assert_eq!(debug, "{DynamicFunction(fn foo() -> i32)}");
|
assert_eq!(debug, "{DynamicFunction(fn foo() -> i32)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ mod tests {
|
|||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:?}", signature),
|
format!("{signature:?}"),
|
||||||
"(&mut alloc::string::String, i32) -> ()"
|
"(&mut alloc::string::String, i32) -> ()"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2608,7 +2608,7 @@ bevy_reflect::tests::Test {
|
|||||||
let foo = Foo { a: 1 };
|
let foo = Foo { a: 1 };
|
||||||
let foo: &dyn Reflect = &foo;
|
let foo: &dyn Reflect = &foo;
|
||||||
|
|
||||||
assert_eq!("123", format!("{:?}", foo));
|
assert_eq!("123", format!("{foo:?}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -2861,7 +2861,7 @@ bevy_reflect::tests::Test {
|
|||||||
test_unknown_tuple_struct.insert(14);
|
test_unknown_tuple_struct.insert(14);
|
||||||
test_struct.insert("unknown_tuplestruct", test_unknown_tuple_struct);
|
test_struct.insert("unknown_tuplestruct", test_unknown_tuple_struct);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:?}", test_struct),
|
format!("{test_struct:?}"),
|
||||||
"DynamicStruct(bevy_reflect::tests::TestStruct { \
|
"DynamicStruct(bevy_reflect::tests::TestStruct { \
|
||||||
tuple: DynamicTuple((0, 1)), \
|
tuple: DynamicTuple((0, 1)), \
|
||||||
tuple_struct: DynamicTupleStruct(bevy_reflect::tests::TestTupleStruct(8)), \
|
tuple_struct: DynamicTupleStruct(bevy_reflect::tests::TestTupleStruct(8)), \
|
||||||
|
@ -191,8 +191,7 @@ impl DynamicList {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::List(_)),
|
matches!(represented_type, TypeInfo::List(_)),
|
||||||
"expected TypeInfo::List but received: {:?}",
|
"expected TypeInfo::List but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,8 +236,7 @@ impl DynamicMap {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::Map(_)),
|
matches!(represented_type, TypeInfo::Map(_)),
|
||||||
"expected TypeInfo::Map but received: {:?}",
|
"expected TypeInfo::Map but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ thread_local! {
|
|||||||
pub(super) fn make_custom_error<E: Error>(msg: impl Display) -> E {
|
pub(super) fn make_custom_error<E: Error>(msg: impl Display) -> E {
|
||||||
#[cfg(feature = "debug_stack")]
|
#[cfg(feature = "debug_stack")]
|
||||||
return TYPE_INFO_STACK
|
return TYPE_INFO_STACK
|
||||||
.with_borrow(|stack| E::custom(format_args!("{} (stack: {:?})", msg, stack)));
|
.with_borrow(|stack| E::custom(format_args!("{msg} (stack: {stack:?})")));
|
||||||
#[cfg(not(feature = "debug_stack"))]
|
#[cfg(not(feature = "debug_stack"))]
|
||||||
return E::custom(msg);
|
return E::custom(msg);
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Poor man's comparison since we can't derive PartialEq for Arc<dyn Enemy>
|
// Poor man's comparison since we can't derive PartialEq for Arc<dyn Enemy>
|
||||||
assert_eq!(format!("{:?}", expected), format!("{:?}", output));
|
assert_eq!(format!("{expected:?}"), format!("{output:?}",));
|
||||||
|
|
||||||
let unexpected = Level {
|
let unexpected = Level {
|
||||||
name: String::from("Level 1"),
|
name: String::from("Level 1"),
|
||||||
@ -414,7 +414,7 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Poor man's comparison since we can't derive PartialEq for Arc<dyn Enemy>
|
// Poor man's comparison since we can't derive PartialEq for Arc<dyn Enemy>
|
||||||
assert_ne!(format!("{:?}", unexpected), format!("{:?}", output));
|
assert_ne!(format!("{unexpected:?}"), format!("{output:?}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -23,7 +23,7 @@ thread_local! {
|
|||||||
pub(super) fn make_custom_error<E: Error>(msg: impl Display) -> E {
|
pub(super) fn make_custom_error<E: Error>(msg: impl Display) -> E {
|
||||||
#[cfg(feature = "debug_stack")]
|
#[cfg(feature = "debug_stack")]
|
||||||
return TYPE_INFO_STACK
|
return TYPE_INFO_STACK
|
||||||
.with_borrow(|stack| E::custom(format_args!("{} (stack: {:?})", msg, stack)));
|
.with_borrow(|stack| E::custom(format_args!("{msg} (stack: {stack:?})")));
|
||||||
#[cfg(not(feature = "debug_stack"))]
|
#[cfg(not(feature = "debug_stack"))]
|
||||||
return E::custom(msg);
|
return E::custom(msg);
|
||||||
}
|
}
|
||||||
|
@ -158,8 +158,7 @@ impl DynamicSet {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::Set(_)),
|
matches!(represented_type, TypeInfo::Set(_)),
|
||||||
"expected TypeInfo::Set but received: {:?}",
|
"expected TypeInfo::Set but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,8 +292,7 @@ impl DynamicStruct {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::Struct(_)),
|
matches!(represented_type, TypeInfo::Struct(_)),
|
||||||
"expected TypeInfo::Struct but received: {:?}",
|
"expected TypeInfo::Struct but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,8 +227,7 @@ impl DynamicTuple {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::Tuple(_)),
|
matches!(represented_type, TypeInfo::Tuple(_)),
|
||||||
"expected TypeInfo::Tuple but received: {:?}",
|
"expected TypeInfo::Tuple but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
self.represented_type = represented_type;
|
self.represented_type = represented_type;
|
||||||
|
@ -242,8 +242,7 @@ impl DynamicTupleStruct {
|
|||||||
if let Some(represented_type) = represented_type {
|
if let Some(represented_type) = represented_type {
|
||||||
assert!(
|
assert!(
|
||||||
matches!(represented_type, TypeInfo::TupleStruct(_)),
|
matches!(represented_type, TypeInfo::TupleStruct(_)),
|
||||||
"expected TypeInfo::TupleStruct but received: {:?}",
|
"expected TypeInfo::TupleStruct but received: {represented_type:?}"
|
||||||
represented_type
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ fn main() {
|
|||||||
.join(format!("{}.png", to_run.technical_name)),
|
.join(format!("{}.png", to_run.technical_name)),
|
||||||
);
|
);
|
||||||
if let Err(err) = renamed_screenshot {
|
if let Err(err) = renamed_screenshot {
|
||||||
println!("Failed to rename screenshot: {}", err);
|
println!("Failed to rename screenshot: {err}");
|
||||||
no_screenshot_examples.push((to_run, duration));
|
no_screenshot_examples.push((to_run, duration));
|
||||||
} else {
|
} else {
|
||||||
successful_examples.push((to_run, duration));
|
successful_examples.push((to_run, duration));
|
||||||
@ -373,12 +373,12 @@ fn main() {
|
|||||||
let stdout = String::from_utf8_lossy(&result.stdout);
|
let stdout = String::from_utf8_lossy(&result.stdout);
|
||||||
let stderr = String::from_utf8_lossy(&result.stderr);
|
let stderr = String::from_utf8_lossy(&result.stderr);
|
||||||
if show_logs {
|
if show_logs {
|
||||||
println!("{}", stdout);
|
println!("{stdout}");
|
||||||
println!("{}", stderr);
|
println!("{stderr}");
|
||||||
}
|
}
|
||||||
if report_details {
|
if report_details {
|
||||||
let mut file =
|
let mut file =
|
||||||
File::create(format!("{reports_path}/{}.log", example)).unwrap();
|
File::create(format!("{reports_path}/{example}.log")).unwrap();
|
||||||
file.write_all(b"==== stdout ====\n").unwrap();
|
file.write_all(b"==== stdout ====\n").unwrap();
|
||||||
file.write_all(stdout.as_bytes()).unwrap();
|
file.write_all(stdout.as_bytes()).unwrap();
|
||||||
file.write_all(b"\n==== stderr ====\n").unwrap();
|
file.write_all(b"\n==== stderr ====\n").unwrap();
|
||||||
@ -628,7 +628,7 @@ header_message = \"Examples ({})\"
|
|||||||
optimize_size,
|
optimize_size,
|
||||||
api,
|
api,
|
||||||
} => {
|
} => {
|
||||||
let api = format!("{}", api);
|
let api = format!("{api}");
|
||||||
let examples_to_build = parse_examples();
|
let examples_to_build = parse_examples();
|
||||||
|
|
||||||
let root_path = Path::new(&content_folder);
|
let root_path = Path::new(&content_folder);
|
||||||
|
Loading…
Reference in New Issue
Block a user