From 73c339d82b2e7b43843f6b3f1b94ac610bbfda04 Mon Sep 17 00:00:00 2001 From: Tokarak <63452145+Tokarak@users.noreply.github.com> Date: Sat, 17 Jun 2023 10:51:48 +0100 Subject: [PATCH] Style changes --- Library/Homebrew/hardware.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index 6033f92aa5..3ec3e3599d 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -41,8 +41,10 @@ module Hardware end alias generic_optimization_flags optimization_flags + # Only give values where it is an improvement over rust cpu defaults + # Rust already defaults to the oldest supported cpu for each target-triple + # Including apple-m1 since Rust 1.71 for aarch64-apple-darwin. def rust_optimisation_flags - # Only give values where it is an improvement over rust cpu defaults @rust_optimisation_flags ||= { native: "-Ctarget-cpu=native", nehalem: "-Ctarget-cpu=nehalem", @@ -224,11 +226,7 @@ module Hardware alias generic_oldest_cpu oldest_cpu # Returns a _full_ rustflag to set target cpu, if necessary; - # Falls back to empty string - # This mirrors the logic of `oldest_cpu`, - # But only where it is version dependent. - # Rust already defaults to the oldest supported cpu for the target-triple - # Including apple-m1 since 1.71. + # Defaults to empty string sig { returns(String) } def rustflags_target_cpu CPU.rust_optimisation_flags.fetch(oldest_cpu, "")