formatting things and pre commit hooks

This commit is contained in:
Schrottkatze 2023-11-20 12:59:32 +01:00
parent daa551caa3
commit b07eb248f1
4 changed files with 17 additions and 10 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.devenv/
.direnv/
/target
.pre-commit-config.yaml

View file

@ -30,6 +30,12 @@
enable = true;
channel = "nightly";
};
pre-commit.hooks = {
clippy.enable = true;
rustfmt.enable = true;
};
packages = [];
})
];

View file

@ -1,5 +1,3 @@
use codespan_reporting::{
diagnostic::{Diagnostic, Label},
files::SimpleFiles,

View file

@ -112,7 +112,9 @@ impl From<TypeDef<'_>> for InternalTypeDef {
match value {
TypeDef::Type(val) => Self::Single(TypeNamespaceId::Types(val.id)),
TypeDef::Trait(val) => Self::Single(TypeNamespaceId::Traits(val.id)),
TypeDef::List(list) => Self::List(list.into_iter().map(std::convert::Into::into).collect()),
TypeDef::List(list) => {
Self::List(list.into_iter().map(std::convert::Into::into).collect())
}
TypeDef::Record(rec) => Self::Record(
rec.into_iter()
.map(|(name, typ)| (name, typ.into()))