Skip to content

Commit

Permalink
Fix Display implementation for typeshed VERSIONS parser (#11848)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Jun 12, 2024
1 parent 4ed3aed commit bcbddac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/red_knot/src/typeshed_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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-
"###
);

Expand Down

0 comments on commit bcbddac

Please sign in to comment.