|
1 | 1 | #![crate_name = "foo"] |
2 | 2 |
|
3 | | -use std::ops::Add; |
4 | 3 | use std::fmt::Display; |
| 4 | +use std::ops::Add; |
5 | 5 |
|
6 | | -//@count foo/fn.function_with_a_really_long_name.html //pre/br 2 |
7 | | -pub fn function_with_a_really_long_name(parameter_one: i32, |
8 | | - parameter_two: i32) |
9 | | - -> Option<i32> { |
| 6 | +// @matches foo/fn.function_with_a_really_long_name.html '//*[@class="rust item-decl"]//code' "\ |
| 7 | +// function_with_a_really_long_name\(\n\ |
| 8 | +// \ parameter_one: i32,\n\ |
| 9 | +// \ parameter_two: i32\n\ |
| 10 | +// \) -> Option<i32>$" |
| 11 | +pub fn function_with_a_really_long_name(parameter_one: i32, parameter_two: i32) -> Option<i32> { |
10 | 12 | Some(parameter_one + parameter_two) |
11 | 13 | } |
12 | 14 |
|
13 | | -//@count foo/fn.short_name.html //pre/br 0 |
14 | | -pub fn short_name(param: i32) -> i32 { param + 1 } |
| 15 | +// @matches foo/fn.short_name.html '//*[@class="rust item-decl"]//code' \ |
| 16 | +// "short_name\(param: i32\) -> i32$" |
| 17 | +pub fn short_name(param: i32) -> i32 { |
| 18 | + param + 1 |
| 19 | +} |
15 | 20 |
|
16 | | -//@count foo/fn.where_clause.html //pre/br 4 |
17 | | -pub fn where_clause<T, U>(param_one: T, |
18 | | - param_two: U) |
19 | | - where T: Add<U> + Display + Copy, |
20 | | - U: Add<T> + Display + Copy, |
21 | | - T::Output: Display + Add<U::Output> + Copy, |
22 | | - <T::Output as Add<U::Output>>::Output: Display, |
23 | | - U::Output: Display + Copy |
| 21 | +// @matches foo/fn.where_clause.html '//*[@class="rust item-decl"]//code' "\ |
| 22 | +// where_clause<T, U>\(param_one: T, param_two: U\)where\n\ |
| 23 | +// \ T: Add<U> \+ Display \+ Copy,\n\ |
| 24 | +// \ U: Add<T> \+ Display \+ Copy,\n\ |
| 25 | +// \ T::Output: Display \+ Add<U::Output> \+ Copy,\n\ |
| 26 | +// \ <T::Output as Add<U::Output>>::Output: Display,\n\ |
| 27 | +// \ U::Output: Display \+ Copy,$" |
| 28 | +pub fn where_clause<T, U>(param_one: T, param_two: U) |
| 29 | +where |
| 30 | + T: Add<U> + Display + Copy, |
| 31 | + U: Add<T> + Display + Copy, |
| 32 | + T::Output: Display + Add<U::Output> + Copy, |
| 33 | + <T::Output as Add<U::Output>>::Output: Display, |
| 34 | + U::Output: Display + Copy, |
24 | 35 | { |
25 | 36 | let x = param_one + param_two; |
26 | 37 | println!("{} + {} = {}", param_one, param_two, x); |
|
0 commit comments