From 434e9e2f3eb4c0a3059e6d544eb14e27941b1d24 Mon Sep 17 00:00:00 2001 From: Jacob Phillips Date: Mon, 26 Feb 2024 22:11:26 +0000 Subject: [PATCH] add bash completions, run cargo fmt --- .devcontainer/Dockerfile | 1 + .devcontainer/docker-compose.yml | 2 +- .devcontainer/post-create.sh | 6 ++++++ .dockerignore | 1 + .gitignore | 1 + lib/tests/common/fixtures/worked_at.rs | 8 ++------ macros/src/derive/entity/new_and_getters.rs | 1 - 7 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8ec05c1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM mcr.microsoft.com/devcontainers/rust:bookworm diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 5388df9..3db83cf 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -4,7 +4,7 @@ services: app: build: context: .. - image: mcr.microsoft.com/devcontainers/rust:bookworm + dockerfile: .devcontainer/Dockerfile depends_on: - db command: sleep infinity diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 52a5b67..029d131 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -6,3 +6,9 @@ ln -s /cypher-dto/.devcontainer/.bash_history ~/.bash_history # Install dotfiles gh repo clone dotfiles ~/dotfiles && ~/dotfiles/install.sh + +# rustup and cargo bash completion. +sudo apt-get update -qq && sudo apt-get install -y -qq --no-install-recommends bash-completion \ + && mkdir -p ~/.local/share/bash-completion/completions \ + && rustup completions bash > ~/.local/share/bash-completion/completions/rustup \ + && rustup completions bash cargo > ~/.local/share/bash-completion/completions/cargo diff --git a/.dockerignore b/.dockerignore index 2f7896d..61a070b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ target/ +.Trash-* diff --git a/.gitignore b/.gitignore index d4a1f50..7a7ef5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target/ .bash_history +.Trash-* diff --git a/lib/tests/common/fixtures/worked_at.rs b/lib/tests/common/fixtures/worked_at.rs index 94937ef..f845808 100644 --- a/lib/tests/common/fixtures/worked_at.rs +++ b/lib/tests/common/fixtures/worked_at.rs @@ -36,9 +36,7 @@ impl TryFrom for WorkedAt { impl RelationEntity for WorkedAt { type Id = WorkedAtId; fn identifier(&self) -> Self::Id { - WorkedAtId { - until: self.until, - } + WorkedAtId { until: self.until } } } impl TryFrom for WorkedAt { @@ -71,9 +69,7 @@ impl RelationId for WorkedAtId { } impl From for WorkedAtId { fn from(value: WorkedAt) -> Self { - WorkedAtId { - until: value.until, - } + WorkedAtId { until: value.until } } } impl TryFrom for WorkedAtId { diff --git a/macros/src/derive/entity/new_and_getters.rs b/macros/src/derive/entity/new_and_getters.rs index 5e534c9..8e52ffe 100644 --- a/macros/src/derive/entity/new_and_getters.rs +++ b/macros/src/derive/entity/new_and_getters.rs @@ -1,7 +1,6 @@ use super::{ArgHelper, Entity}; use quote::{__private::TokenStream, quote}; - pub fn impl_new_and_getters(entity: &Entity) -> TokenStream { let entity_ident = entity.ident(); let mut idents = Vec::new();