Skip to content

Commit a56d0e2

Browse files
authored
swap function order for better read flow
When having the order ``` foo.bar(); // we can now use this method since i32 implements the Foo trait [...] impl Foo for i32 ``` the `// we can now use this method` comment is less clear to me.
1 parent 703f2e1 commit a56d0e2

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+5
-5
lines changed

compiler/rustc_error_codes/src/error_codes/E0277.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ trait Foo {
2929
fn bar(&self);
3030
}
3131
32-
fn some_func<T: Foo>(foo: T) {
33-
foo.bar(); // we can now use this method since i32 implements the
34-
// Foo trait
35-
}
36-
3732
// we implement the trait on the i32 type
3833
impl Foo for i32 {
3934
fn bar(&self) {}
4035
}
4136
37+
fn some_func<T: Foo>(foo: T) {
38+
foo.bar(); // we can now use this method since i32 implements the
39+
// Foo trait
40+
}
41+
4242
fn main() {
4343
some_func(5i32); // ok!
4444
}

0 commit comments

Comments
 (0)