Skip to content

Commit 0263b94

Browse files
committed
fmt
1 parent 10d4537 commit 0263b94

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/clippy_changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Check Changelog
2525
if: ${{ github.event_name == 'pull_request' }}
2626
run: |
27-
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR_NUMBER" | \
27+
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/${{ github.repository_owner }}/rust-clippy/pulls/$PR_NUMBER" | \
2828
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
2929
output=$(awk '/^changelog:\s*\S/ && !/changelog: \[.*\]: your change/' <<< "$body" | sed "s/changelog:\s*//g")
3030
if [ -z "$output" ]; then

clippy_lints/src/vec.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ enum VecState {
6161
pub struct UselessVec {
6262
too_large_for_stack: u64,
6363
msrv: Msrv,
64-
/// Maps from a `vec![]` source callsite invocation span to the "state" (i.e., whether we can emit a warning there or not).
64+
/// Maps from a `vec![]` source callsite invocation span to the "state" (i.e., whether we can
65+
/// emit a warning there or not).
6566
///
66-
/// The purpose of this is to buffer lints up until `check_expr_post` so that we can cancel a lint while visiting,
67-
/// because a `vec![]` invocation span can appear multiple times when it is passed as a macro argument,
68-
/// once in a context that doesn't require a `Vec<_>` and another time that does. Consider:
69-
/// ```
67+
/// The purpose of this is to buffer lints up until `check_expr_post` so that we can cancel a
68+
/// lint while visiting, because a `vec![]` invocation span can appear multiple times when
69+
/// it is passed as a macro argument, once in a context that doesn't require a `Vec<_>` and
70+
/// another time that does. Consider: ```
7071
/// macro_rules! m {
7172
/// ($v:expr) => {
7273
/// let a = $v;
@@ -75,8 +76,9 @@ pub struct UselessVec {
7576
/// }
7677
/// m!(vec![1, 2]);
7778
/// ```
78-
/// The macro invocation expands to two `vec![1, 2]` invocations. If we eagerly suggest changing it to an array,
79-
/// we get a false positive warning on the `$v.push(3)` which really requires `$v` to be a vector.
79+
/// The macro invocation expands to two `vec![1, 2]` invocations. If we eagerly suggest changing
80+
/// it to an array, we get a false positive warning on the `$v.push(3)` which really
81+
/// requires `$v` to be a vector.
8082
span_to_state: BTreeMap<Span, VecState>,
8183
allow_in_test: bool,
8284
}
@@ -93,7 +95,8 @@ impl UselessVec {
9395
}
9496

9597
enum VecToArray {
96-
/// Expression does not need to be a `Vec<_>` and its type can be changed to an array (or slice).
98+
/// Expression does not need to be a `Vec<_>` and its type can be changed to an array (or
99+
/// slice).
97100
Possible,
98101
/// Expression must be a `Vec<_>`. Type cannot change.
99102
Impossible,

0 commit comments

Comments
 (0)