From 2f9a3800b976fb88f99a805dbb53f6ff6290a7ab Mon Sep 17 00:00:00 2001 From: William Boman Date: Sun, 3 Oct 2021 21:15:32 +0200 Subject: assign to local var for less verbose expressions --- .../servers/rust_analyzer/init.lua | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'lua/nvim-lsp-installer/servers/rust_analyzer/init.lua') diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua index c81e37b1..fc843964 100644 --- a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua +++ b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua @@ -5,26 +5,28 @@ local std = require "nvim-lsp-installer.installers.std" local context = require "nvim-lsp-installer.installers.context" local Data = require "nvim-lsp-installer.data" -local target = Data.coalesce( - Data.when( +local coalesce, when = Data.coalesce, Data.when + +local target = coalesce( + when( platform.is_mac, - Data.coalesce( - Data.when(platform.arch == "arm64", "rust-analyzer-aarch64-apple-darwin.gz"), - Data.when(platform.arch == "x64", "rust-analyzer-x86_64-apple-darwin.gz") + coalesce( + when(platform.arch == "arm64", "rust-analyzer-aarch64-apple-darwin.gz"), + when(platform.arch == "x64", "rust-analyzer-x86_64-apple-darwin.gz") ) ), - Data.when( + when( platform.is_linux, - Data.coalesce( - Data.when(platform.arch == "arm64", "rust-analyzer-aarch64-unknown-linux-gnu.gz"), - Data.when(platform.arch == "x64", "rust-analyzer-x86_64-unknown-linux-gnu.gz") + coalesce( + when(platform.arch == "arm64", "rust-analyzer-aarch64-unknown-linux-gnu.gz"), + when(platform.arch == "x64", "rust-analyzer-x86_64-unknown-linux-gnu.gz") ) ), - Data.when( + when( platform.is_win, - Data.coalesce( - Data.when(platform.arch == "arm64", "rust-analyzer-aarch64-pc-windows-msvc.gz"), - Data.when(platform.arch == "x64", "rust-analyzer-x86_64-pc-windows-msvc.gz") + coalesce( + when(platform.arch == "arm64", "rust-analyzer-aarch64-pc-windows-msvc.gz"), + when(platform.arch == "x64", "rust-analyzer-x86_64-pc-windows-msvc.gz") ) ) ) -- cgit v1.2.3-70-g09d2