From bcbddac21c94a3bc48511dbe5b3d873fef1239fb Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 12 Jun 2024 20:56:52 +0100 Subject: [PATCH] Fix `Display` implementation for typeshed `VERSIONS` parser (#11848) --- crates/red_knot/src/typeshed_versions.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/red_knot/src/typeshed_versions.rs b/crates/red_knot/src/typeshed_versions.rs index e60d8f04f5ee9..4653ed73778c4 100644 --- a/crates/red_knot/src/typeshed_versions.rs +++ b/crates/red_knot/src/typeshed_versions.rs @@ -178,7 +178,7 @@ impl fmt::Display for TypeshedVersions { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let sorted_items: BTreeMap<&SmolStr, &PyVersionRange> = self.0.iter().collect(); for (module_name, range) in sorted_items { - writeln!(f, "{module_name}-{range}")?; + writeln!(f, "{module_name}: {range}")?; } Ok(()) } @@ -362,9 +362,9 @@ foo: 3.8- # trailing comment let parsed_versions = TypeshedVersions::from_str(VERSIONS).unwrap(); assert_eq!(parsed_versions.len(), 3); assert_snapshot!(parsed_versions.to_string(), @r###" - bar-2.7-3.10 - bar.baz-3.1-3.9 - foo-3.8- + bar: 2.7-3.10 + bar.baz: 3.1-3.9 + foo: 3.8- "### );