Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept any Into<AnyNodeRef> as Comments arguments #5205

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

MichaReiser
Copy link
Member

Summary

This PR makes the Comments methods generic so that they accept any Into<AnyNodeRef>. This removes the need to call .into() in the formatter code.

Test Plan

cargo build

@MichaReiser MichaReiser mentioned this pull request Jun 20, 2023
@MichaReiser
Copy link
Member Author

MichaReiser commented Jun 20, 2023

@MichaReiser MichaReiser requested a review from konstin June 20, 2023 07:45
@MichaReiser MichaReiser added the formatter Related to the formatter label Jun 20, 2023
@MichaReiser MichaReiser mentioned this pull request Jun 20, 2023
Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

@MichaReiser
Copy link
Member Author

@MichaReiser started a stack merge that includes this pull request via Graphite.

Base automatically changed from best-fitting-mode to main June 20, 2023 16:16
@MichaReiser
Copy link
Member Author

Graphite rebased this pull request as part of a merge.

@MichaReiser
Copy link
Member Author

Graphite couldn't merge this PR because it was not satisfying all requirements.

@MichaReiser MichaReiser enabled auto-merge (squash) June 20, 2023 16:35
@MichaReiser MichaReiser merged commit b369288 into main Jun 20, 2023
@MichaReiser MichaReiser deleted the comments-any-into-AnyNodeRef branch June 20, 2023 16:49
@github-actions
Copy link
Contributor

github-actions bot commented Jun 20, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.01      6.4±0.03ms     6.3 MB/sec    1.00      6.4±0.01ms     6.4 MB/sec
formatter/numpy/ctypeslib.py               1.01   1357.5±3.00µs    12.3 MB/sec    1.00   1344.8±2.93µs    12.4 MB/sec
formatter/numpy/globals.py                 1.00    134.3±0.17µs    22.0 MB/sec    1.00    134.0±2.16µs    22.0 MB/sec
formatter/pydantic/types.py                1.00      2.7±0.04ms     9.6 MB/sec    1.00      2.6±0.01ms     9.7 MB/sec
linter/all-rules/large/dataset.py          1.00     13.0±0.06ms     3.1 MB/sec    1.01     13.2±0.06ms     3.1 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.3±0.02ms     5.1 MB/sec    1.01      3.3±0.01ms     5.1 MB/sec
linter/all-rules/numpy/globals.py          1.00    429.7±0.57µs     6.9 MB/sec    1.01    433.3±1.04µs     6.8 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.8±0.01ms     4.4 MB/sec    1.01      5.9±0.04ms     4.4 MB/sec
linter/default-rules/large/dataset.py      1.00      6.6±0.02ms     6.2 MB/sec    1.02      6.7±0.02ms     6.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1470.0±1.64µs    11.3 MB/sec    1.01   1484.6±5.75µs    11.2 MB/sec
linter/default-rules/numpy/globals.py      1.00    166.5±0.20µs    17.7 MB/sec    1.01    168.4±2.10µs    17.5 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.0±0.01ms     8.4 MB/sec    1.01      3.1±0.01ms     8.3 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      7.7±0.06ms     5.3 MB/sec    1.08      8.4±0.03ms     4.9 MB/sec
formatter/numpy/ctypeslib.py               1.00  1541.4±10.55µs    10.8 MB/sec    1.07  1648.6±13.71µs    10.1 MB/sec
formatter/numpy/globals.py                 1.00    151.9±1.38µs    19.4 MB/sec    1.05    159.9±2.37µs    18.5 MB/sec
formatter/pydantic/types.py                1.00      3.2±0.02ms     8.0 MB/sec    1.07      3.4±0.02ms     7.5 MB/sec
linter/all-rules/large/dataset.py          1.01     15.7±0.11ms     2.6 MB/sec    1.00     15.5±0.09ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.1±0.03ms     4.1 MB/sec    1.00      4.1±0.02ms     4.1 MB/sec
linter/all-rules/numpy/globals.py          1.00    428.2±5.72µs     6.9 MB/sec    1.00    429.6±5.45µs     6.9 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.0±0.06ms     3.7 MB/sec    1.00      6.9±0.04ms     3.7 MB/sec
linter/default-rules/large/dataset.py      1.00      8.3±0.06ms     4.9 MB/sec    1.00      8.3±0.04ms     4.9 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01  1716.9±12.50µs     9.7 MB/sec    1.00  1695.0±10.79µs     9.8 MB/sec
linter/default-rules/numpy/globals.py      1.00    183.3±1.21µs    16.1 MB/sec    1.00    183.3±1.40µs    16.1 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.7±0.02ms     6.8 MB/sec    1.00      3.7±0.01ms     6.9 MB/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants