MCPcopy Create free account

hub / github.com/Apress/beginning-rust-2e / functions

Functions846 in github.com/Apress/beginning-rust-2e

Functionmain
It prints: 3 4 5 6 */
Source Code/15-25.rs:3
Functionmain
It prints: 65*/
Source Code/03-01.rs:3
Functionmain
ILLEGAL. The compiler prints twice the error message: mismatched types both one with the explanation: expected `i16`, found floating-point number */
Source Code/10-02.rs:6
Functionmain
ILLEGAL. The compiler prints the error message: no method named `abs` found for type parameter `Number` in the current scope */
Source Code/19-09.rs:4
Functionmain
It prints: 12 12 23*/
Source Code/23-07.rs:3
Functionmain
It prints: Hello, [Hi]*/
Source Code/20-18.rs:3
Functionmain
It prints: 0 a, 1 b, 2 c, */
Source Code/16-33.rs:3
Functionmain
It prints nothing. */
Source Code/10-10.rs:3
Functionmain
It prints: None, Some(22), None, Some(4.3)*/
Source Code/19-34.rs:3
Functionmain
It prints: abc. XYZ. 123.*/
Source Code/05-13.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: no method named `naming` found for struct `Person` in the current scope */
Source Code/18-06.rs:4
Functionmain
The compiler prints three warnings, and then the program prints nothing. */
Source Code/19-10.rs:4
Functionmain
It first prints: true false false true 4 and then it panics with the message: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Source Code/10-20.rs:8
Functionmain
It prints: 37*/
Source Code/10-03.rs:3
Functionmain
It prints: Hello, [Hi]*/
Source Code/20-20.rs:3
Functionmain
It prints: 11 21 31 */
Source Code/16-15.rs:3
Functionmain
It prints: 0*/
Source Code/16-44.rs:3
Functionmain
It prints nothing. */
Source Code/10-09.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: mismatched types */
Source Code/05-24.rs:4
Functionmain
It prints: 15*/
Source Code/15-10.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: cannot find value `a` in this scope */
Source Code/09-03.rs:4
Functionmain
It prints: abcd abcd*/
Source Code/18-01.rs:3
Functionmain
It prints: 7 7; 7 7 9; 7 7 7*/
Source Code/11-08.rs:3
Functionmain
It prints: 4 0*/
Source Code/09-17.rs:3
Functionmain
It prints: "Hello, world!" does not contain 'R'.*/
Source Code/16-37.rs:3
Functionmain
It prints: 13*/
Source Code/24-19.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: the type `[{integer}]` cannot be indexed by `std::ops::Range<i32>` */
Source Code/15-18.rs:4
Functionmain
It prints nothing. */
Source Code/05-23.rs:3
Functionmain
It prints: 18.767569280959872*/
Source Code/19-25.rs:3
Functionmain
It prints: 4 4 */
Source Code/12-03.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: `if` and `else` have incompatible types */
Source Code/04-08.rs:4
Functionmain
It prints: None, Some(22), None, Some(4.3)*/
Source Code/19-33.rs:3
Functionmain
It prints: small*/
Source Code/04-04.rs:3
Functionmain
It prints: [0, 1, 4, 7, 8, 10, 12, 45]*/
Source Code/13-01.rs:3
Functionmain
It prints: "Hello, world!" contains 'r'.*/
Source Code/16-36.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: type annotations needed */
Source Code/03-24.rs:4
Functionmain
It prints: 4 4 */
Source Code/12-04.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: borrow of moved value: `v1` */
Source Code/22-04.rs:4
Functionmain
It prints: This is a nice sentence.*/
Source Code/05-12.rs:3
Functionmain
It prints: 4 4*/
Source Code/22-08.rs:3
Functionmain
ILLEGAL. The compiler prints three times the error message: the size for values of type `str` cannot be known at compilation time */
Source Code/14-03.rs:4
Functionmain
It prints: 3 3*/
Source Code/18-02.rs:3
Functionmain
ILLEGAL. The compiler prints twice the error message: mismatched types once with the explanation: expected `i16`, found floating-point number and once
Source Code/09-11.rs:8
Functionmain
It prints: My number: 140*/
Source Code/01-09.rs:3
Functionmain
Source Code/23-05.cpp:6
Functionmain
It prints: 17 22*/
Source Code/15-12.rs:3
Functionmain
It prints: 3.4 [1, 2, 3] 3.4 true*/
Source Code/11-06.rs:3
Functionmain
It prints: First line Second line Third line */
Source Code/01-04.rs:6
Functionmain
It prints: false true false false false true false true true true */
Source Code/03-19.rs:6
Functionmain
ILLEGAL. The compiler prints the error message: the name `f` is defined multiple times */
Source Code/09-05.rs:4
Functionmain
()
Source Code/09-08.rs:6
Functionmain
It prints: 11 21 31 */
Source Code/16-26.rs:3
Functionmain
It prints: 1 2 3.14*/
Source Code/03-27.rs:3
Functionmain
It prints: 3 1, 2 2, 1 3, 0 4, -1 5, -1*/
Source Code/04-18.rs:3
Functionmain
It prints: The sum is 115.1*/
Source Code/02-04.rs:3
Functionmain
ILLEGAL. The compiler prints the two error messages: format argument must be a string literal and 1 positional argument in format string, but no argum
Source Code/14-11.rs:6
Functionmain
It prints: 11 21 31 */
Source Code/16-14.rs:3
Functionmain
It prints nothing. */
Source Code/23-11.rs:3
Functionmain
It prints: 12 true 13*/
Source Code/23-20.rs:3
Functionmain
It prints nothing. */
Source Code/06-32.rs:3
Functionmain
It prints: As*/
Source Code/07-01.rs:3
Functionmain
It prints: 11 21 31 */
Source Code/16-09.rs:3
Functionmain
It prints nothing. */
Source Code/05-30.rs:3
Functionmain
It prints: 132 -16 86 38 0 -62 */
Source Code/16-29.rs:3
Functionmain
It prints: 23, 56*/
Source Code/05-17.rs:3
Functionmain
It prints: 15.625001 15.625000000000002 15.625001 15.625000000000002 15.625000000000002 */
Source Code/19-27.rs:8
Functionmain
It prints: [132, 86, 38]*/
Source Code/16-53.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: no method named `clone` found for struct `File` in the current scope */
Source Code/22-21.rs:4
Functionmain
It prints: 123*/
Source Code/18-13.rs:3
Functionmain
It prints: true 4 Hello 3.14*/
Source Code/23-16.rs:3
Functionmain
It prints: 1 4 9 16 25 36 49 64 81 100 */
Source Code/04-10.rs:3
Functionmain
ILLEGAL. The compiler prints twice the error message: mismatched types */
Source Code/05-26.rs:4
Functionmain
It prints: (4.5, 'A') (-6.0, 'g')*/
Source Code/10-13.rs:3
Functionmain
It prints: Ok(4.0), Err("Divide by zero")*/
Source Code/10-18.rs:3
Functionmain
It prints: 1 0 2 0 3 0 ... and so on, until the stack is overflowed. Then, the following panic message will be printed: thread 'main' has overflowed i
Source Code/11-04.rs:10
Functionmain
It prints: Hello, world!*/
Source Code/14-15.rs:3
Functionmain
The compiler prints the warning message: unused variable: `number` Then, the program prints nothing. */
Source Code/03-11.rs:5
Functionmain
ILLEGAL. The compiler prints the error message: borrow of possibly-uninitialized variable: `number1` */
Source Code/03-10.rs:4
Functionmain
It prints: John Doe*/
Source Code/18-05.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: this operation will panic at runtime with the explanation: index out of bounds: the length is 1 but th
Source Code/05-09.rs:8
Functionmain
It prints nothing. */
Source Code/06-22.rs:3
Functionmain
It prints nothing. */
Source Code/24-02.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: this operation will panic at runtime with the explanation: index out of bounds: the length is 1 but th
Source Code/05-06.rs:6
Functionmain
It prints: 1234567*/
Source Code/04-20.rs:3
Functionmain
It prints: 1 2 3.14*/
Source Code/03-26.rs:3
Functionmain
It prints all the integer numbers from 0 to 9999, and then the time spent for such prints: */
Source Code/21-01.rs:4
Functionmain
It prints: -8 -31 */
Source Code/16-27.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: borrow of possibly-uninitialized variable: `_n` with the explanation: use of possibly-uninitialized `_
Source Code/23-09.rs:6
Functionmain
It prints: Converted to 1.5 Conversion error: precision loss Conversion error: too large number Conversion error: too small number */
Source Code/20-16.rs:7
Functionmain
ILLEGAL. The compiler prints the error message: `_n` does not live long enough */
Source Code/23-10.rs:4
Functionmain
It prints nothing. */
Source Code/07-05.rs:3
Functionmain
It prints: 11 21 31 */
Source Code/16-21.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: no method named `sqrt` found for type parameter `Number` in the current scope */
Source Code/19-03.rs:4
Functionmain
It prints: 0 1 2 3 4 5 6 7 8 9 10 11 */
Source Code/15-01.rs:15
Functionmain
It prints: 1 4 16 25 49 64 100 121 169 196 256 289 361 400 */
Source Code/04-11.rs:3
Functionmain
It prints: () 283 () () () ()*/
Source Code/06-29.rs:3
Functionmain
It prints: 4, 3.14*/
Source Code/05-15.rs:3
Functionmain
It prints: [132, 86, 38]*/
Source Code/16-56.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: the trait bound `bool: Sum` is not satisfied */
Source Code/16-45.rs:4
Functionmain
In a 64-bit system, it will print something different from run to run, but similar to: 0x7ffe16b20c8d 0x7ffe16b20c8e 0x7ffe16b20c8f In a 32-bit system
Source Code/12-09.rs:6
← previousnext →601–700 of 846, ranked by callers