You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/methods.stderr
+99-1Lines changed: 99 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -738,5 +738,103 @@ error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec
738
738
|
739
739
= note: `-D iter-cloned-collect` implied by `-D warnings`
740
740
741
-
error: aborting due to 107 previous errors
741
+
error: you should use the `starts_with` method
742
+
--> $DIR/methods.rs:553:8
743
+
|
744
+
553 | if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
745
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.starts_with('f')`
746
+
747
+
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
748
+
--> $DIR/methods.rs:553:8
749
+
|
750
+
553 | if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
751
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
752
+
753
+
error: you should use the `ends_with` method
754
+
--> $DIR/methods.rs:556:8
755
+
|
756
+
556 | if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
757
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
758
+
|
759
+
= note: `-D chars-last-cmp` implied by `-D warnings`
760
+
761
+
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
762
+
--> $DIR/methods.rs:556:8
763
+
|
764
+
556 | if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
765
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
766
+
767
+
error: you should use the `ends_with` method
768
+
--> $DIR/methods.rs:559:8
769
+
|
770
+
559 | if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
771
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
772
+
773
+
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
774
+
--> $DIR/methods.rs:559:8
775
+
|
776
+
559 | if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
777
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
778
+
779
+
error: you should use the `starts_with` method
780
+
--> $DIR/methods.rs:562:8
781
+
|
782
+
562 | if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
783
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.starts_with('f')`
784
+
785
+
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
786
+
--> $DIR/methods.rs:562:8
787
+
|
788
+
562 | if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
789
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
790
+
791
+
error: you should use the `ends_with` method
792
+
--> $DIR/methods.rs:565:8
793
+
|
794
+
565 | if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
795
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
796
+
797
+
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
798
+
--> $DIR/methods.rs:565:8
799
+
|
800
+
565 | if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
801
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
802
+
803
+
error: you should use the `ends_with` method
804
+
--> $DIR/methods.rs:568:8
805
+
|
806
+
568 | if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
807
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
808
+
809
+
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
810
+
--> $DIR/methods.rs:568:8
811
+
|
812
+
568 | if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
813
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
814
+
815
+
error: you should use the `ends_with` method
816
+
--> $DIR/methods.rs:575:5
817
+
|
818
+
575 | "".chars().last() == Some(' ');
819
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
820
+
821
+
error: you should use the `ends_with` method
822
+
--> $DIR/methods.rs:576:5
823
+
|
824
+
576 | Some(' ') != "".chars().last();
825
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
826
+
827
+
error: you should use the `ends_with` method
828
+
--> $DIR/methods.rs:577:5
829
+
|
830
+
577 | "".chars().next_back() == Some(' ');
831
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
832
+
833
+
error: you should use the `ends_with` method
834
+
--> $DIR/methods.rs:578:5
835
+
|
836
+
578 | Some(' ') != "".chars().next_back();
837
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
0 commit comments