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/ .devenv/
.direnv/ .direnv/
/target /target
.pre-commit-config.yaml

View file

@ -25,13 +25,19 @@
default = devenv.lib.mkShell { default = devenv.lib.mkShell {
inherit inputs pkgs; inherit inputs pkgs;
modules = [ modules = [
({pkgs, config, ...}: { ({pkgs, config, ...}: {
languages.rust = { languages.rust = {
enable = true; enable = true;
channel = "nightly"; channel = "nightly";
}; };
packages = [];
}) pre-commit.hooks = {
clippy.enable = true;
rustfmt.enable = true;
};
packages = [];
})
]; ];
}; };
}); });

View file

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

View file

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