diff --git a/crates/ide/src/ide/assists/convert_to_inherit.rs b/crates/ide/src/ide/assists/convert_to_inherit.rs index 47aeb75..ef51ac4 100644 --- a/crates/ide/src/ide/assists/convert_to_inherit.rs +++ b/crates/ide/src/ide/assists/convert_to_inherit.rs @@ -15,8 +15,9 @@ pub(super) fn convert_to_inherit(ctx: &mut AssistsCtx<'_>) -> Option<()> { } // RHS should be a single identifier. - let ast::Expr::Ref(rhs) = binding.value()?.flatten_paren()? else { - return None; + let rhs = match binding.value()?.flatten_paren()? { + ast::Expr::Ref(rhs) => rhs, + _ => return None, }; // LHS should be a single static name. @@ -25,8 +26,9 @@ pub(super) fn convert_to_inherit(ctx: &mut AssistsCtx<'_>) -> Option<()> { if attrs.next().is_some() { return None; } - let AttrKind::Static(Some(key)) = AttrKind::of(attr) else { - return None; + let key = match AttrKind::of(attr) { + AttrKind::Static(Some(key)) => key, + _ => return None, }; // LHS should match RHS. diff --git a/flake.nix b/flake.nix index dcbc30e..edb3d32 100644 --- a/flake.nix +++ b/flake.nix @@ -58,10 +58,13 @@ }; devShells.default = pkgs.mkShell { - packages = with pkgs; with rustPkgs; [ + packages = with pkgs; [ # Override the stable rustfmt. - rust-nightly_2022-10-01.availableComponents.rustfmt - rust + rustPkgs.rust-nightly_2022-10-01.availableComponents.rustfmt + # Follows nixpkgs's version of rustc. + (let vers = lib.splitVersion rustc.version; in + rustPkgs."rust_${lib.elemAt vers 0}_${lib.elemAt vers 1}_${lib.elemAt vers 2}") + nix.out # For generation of builtins. gdb jq