chore: Update annotate-snippets to 0.12.10
This commit is contained in:
parent
099308af90
commit
b07013c4fd
5 changed files with 43 additions and 1 deletions
|
|
@ -9,6 +9,9 @@ LL | fn fut() -> impl Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn fut() -> impl Future<Output = i32> {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + async fn fut() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -21,6 +24,9 @@ LL | fn fut2() ->impl Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn fut2() ->impl Future<Output = i32> {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + async fn fut2() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -33,6 +39,9 @@ LL | fn fut3()-> impl Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn fut3()-> impl Future<Output = i32> {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + async fn fut3() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -45,6 +54,9 @@ LL | fn empty_fut() -> impl Future<Output = ()> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn empty_fut() -> impl Future<Output = ()> {
|
||||
LL -
|
||||
LL - async {}
|
||||
LL - }
|
||||
LL + async fn empty_fut() {}
|
||||
|
|
||||
|
||||
|
|
@ -57,6 +69,9 @@ LL | fn empty_fut2() ->impl Future<Output = ()> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn empty_fut2() ->impl Future<Output = ()> {
|
||||
LL -
|
||||
LL - async {}
|
||||
LL - }
|
||||
LL + async fn empty_fut2() {}
|
||||
|
|
||||
|
||||
|
|
@ -69,6 +84,9 @@ LL | fn empty_fut3()-> impl Future<Output = ()> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn empty_fut3()-> impl Future<Output = ()> {
|
||||
LL -
|
||||
LL - async {}
|
||||
LL - }
|
||||
LL + async fn empty_fut3() {}
|
||||
|
|
||||
|
||||
|
|
@ -81,6 +99,9 @@ LL | fn core_fut() -> impl core::future::Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn core_fut() -> impl core::future::Future<Output = i32> {
|
||||
LL -
|
||||
LL - async move { 42 }
|
||||
LL - }
|
||||
LL + async fn core_fut() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -116,6 +137,9 @@ LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + async fn elided(_: &i32) -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -128,6 +152,9 @@ LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> +
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -140,6 +167,9 @@ LL | pub fn issue_10450() -> impl Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - pub fn issue_10450() -> impl Future<Output = i32> {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + pub async fn issue_10450() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -152,6 +182,9 @@ LL | pub(crate) fn issue_10450_2() -> impl Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - pub(crate) fn issue_10450_2() -> impl Future<Output = i32> {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + pub(crate) async fn issue_10450_2() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
@ -164,6 +197,9 @@ LL | pub(self) fn issue_10450_3() -> impl Future<Output = i32> {
|
|||
help: make the function `async` and return the output of the future directly
|
||||
|
|
||||
LL - pub(self) fn issue_10450_3() -> impl Future<Output = i32> {
|
||||
LL -
|
||||
LL - async { 42 }
|
||||
LL - }
|
||||
LL + pub(self) async fn issue_10450_3() -> i32 { 42 }
|
||||
|
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ LL | | .unwrap_or(0);
|
|||
help: use `map_or(<a>, <f>)` instead
|
||||
|
|
||||
LL - let _ = opt.map(|x| x + 1)
|
||||
LL -
|
||||
LL - // Should lint even though this call is on a separate line.
|
||||
LL - .unwrap_or(0);
|
||||
LL + let _ = opt.map_or(0, |x| x + 1);
|
||||
|
|
||||
|
||||
|
|
@ -98,6 +101,7 @@ LL | | .unwrap_or(None);
|
|||
help: use `and_then(<f>)` instead
|
||||
|
|
||||
LL - .map(|x| Some(x + 1))
|
||||
LL - .unwrap_or(None);
|
||||
LL + .and_then(|x| Some(x + 1));
|
||||
|
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ help: otherwise remove the non-wildcard arms
|
|||
|
|
||||
LL - 2 => 'b',
|
||||
LL - 3 => 'b',
|
||||
LL + _ => 'b',
|
||||
|
|
||||
|
||||
error: these match arms have identical bodies
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ LL | | }
|
|||
help: change this to
|
||||
|
|
||||
LL - fn partial_cmp(&self, _: &Self) -> Option<Ordering> {
|
||||
LL - todo!();
|
||||
LL - }
|
||||
LL + fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
|
||||
|
|
||||
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ LL | "name", 5, "x", 0.01
|
|||
help: try
|
||||
|
|
||||
LL - "Hello {}: {2} is {3:.*} (which {3} with {1} places)",
|
||||
LL - "name", 5, "x", 0.01
|
||||
LL + "Hello name: x is {1:.*} (which {1} with {0} places)", 5, 0.01
|
||||
|
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue