diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-05 21:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-05 21:09:15 +0300 |
commit | 6d18e2830d07abf6f3318bd0e11a784bb67dbf52 (patch) | |
tree | bcef28df295708ef804447fed5ae5bdb0cca1db0 /lib/api | |
parent | 2f229658aea96b45edbb28c97a2aa0c58b3433eb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/helpers/packages/conan/api_helpers.rb | 16 | ||||
-rw-r--r-- | lib/api/projects.rb | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/lib/api/helpers/packages/conan/api_helpers.rb b/lib/api/helpers/packages/conan/api_helpers.rb index 24ebeb007d3..5499b6fe653 100644 --- a/lib/api/helpers/packages/conan/api_helpers.rb +++ b/lib/api/helpers/packages/conan/api_helpers.rb @@ -32,19 +32,15 @@ module API end def recipe_upload_urls - { upload_urls: Hash[ - file_names.select(&method(:recipe_file?)).map do |file_name| - [file_name, build_recipe_file_upload_url(file_name)] - end - ] } + { upload_urls: file_names.select(&method(:recipe_file?)).to_h do |file_name| + [file_name, build_recipe_file_upload_url(file_name)] + end } end def package_upload_urls - { upload_urls: Hash[ - file_names.select(&method(:package_file?)).map do |file_name| - [file_name, build_package_file_upload_url(file_name)] - end - ] } + { upload_urls: file_names.select(&method(:package_file?)).to_h do |file_name| + [file_name, build_package_file_upload_url(file_name)] + end } end def recipe_file?(file_name) diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 880ece9048a..7674e67cd8f 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -485,7 +485,7 @@ module API get ':id/languages', feature_category: :source_code_management do ::Projects::RepositoryLanguagesService .new(user_project, current_user) - .execute.map { |lang| [lang.name, lang.share] }.to_h + .execute.to_h { |lang| [lang.name, lang.share] } end desc 'Delete a project' |