MCPcopy Create free account

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

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

Functionmain
ILLEGAL. The compiler prints the three error messages: mismatched types cannot apply unary operator `-` to type `u32` mismatched types */
Source Code/15-05.rs:6
Functionmain
It prints: 2.3 + 6.5i*/
Source Code/20-07.rs:3
Functionmain
It prints: [10, -8, 18, 0, -14, -2, 6, 10, 6, 2]*/
Source Code/09-31.rs:3
Functionmain
It prints: 3.7*/
Source Code/02-08.rs:3
Functionmain
Source Code/22-10.cpp:5
Functionmain
It prints: true false true*/
Source Code/03-17.rs:3
Functionmain
It prints: [36, 1, 15, 9, 4]*/
Source Code/16-48.rs:3
Functionmain
It prints: 12 47*/
Source Code/03-02.rs:3
Functionmain
It prints: 5*/
Source Code/09-20.rs:3
Functionmain
It prints nothing. */
Source Code/18-17.rs:3
Functionmain
It prints nothing. */
Source Code/10-15.rs:3
Functionmain
It prints: My number: 140*/
Source Code/01-12.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: no field `i` on type `({integer}, {integer}, {integer})` */
Source Code/08-04.rs:4
Functionmain
It prints: 2 2 2 8 8 16*/
Source Code/15-04.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: cannot assign twice to immutable variable `item` */
Source Code/16-13.rs:4
Functionmain
ILLEGAL. The compiler prints the error message: `n` does not live long enough */
Source Code/23-01.rs:4
Functionmain
It prints nothing. */
Source Code/06-17.rs:3
Functionmain
It prints: 4 4 */
Source Code/12-01.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: borrow of moved value: `i1` */
Source Code/22-12.rs:4
Functionmain
It prints: 13 true 12*/
Source Code/23-18.rs:3
Functionmain
It prints: 123 123 123 [] [] File*/
Source Code/22-19.rs:3
Functionmain
Source Code/19-05.cpp:12
Functionmain
It prints: Hello, world!*/
Source Code/14-17.rs:3
Functionmain
It prints nothing. */
Source Code/08-13.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: use of moved value: `s` */
Source Code/22-25.rs:4
Functionmain
ILLEGAL. The compiler prints the three error messages: literal out of range for `i8` literal out of range for `u16` literal out of range for `u32` */
Source Code/06-19.rs:6
Functionmain
It prints: 10 14*/
Source Code/04-22.rs:3
Functionmain
ILLEGAL. The compiler prints the two error messages: mismatched types binary operation `==` cannot be applied to type `T` */
Source Code/19-11.rs:5
Functionmain
It prints: [10, -8, 18, 0, -14, -2, 6, 10, 6, 2]*/
Source Code/09-26.rs:3
Functionmain
It prints nothing. */
Source Code/11-01.rs:3
Functionmain
The compiler prints the warning message: variable does not need to be mutable. Then, the program prints: [5, -4, 9, 0, -7, -1, 3, 5, 3, 1]*/
Source Code/09-27.rs:5
Functionmain
ILLEGAL. The compiler prints the error message: type annotations needed for `[_; 0]` with the explanation: cannot infer type */
Source Code/05-28.rs:6
Functionmain
ILLEGAL. The compiler prints the error message: binary operation `<` cannot be applied to type `CardinalPoint` */
Source Code/07-09.rs:4
Functionmain
It prints: 12*/
Source Code/15-09.rs:3
Functionmain
It prints nothing, but it tries to copy the file whose name is the first command-line argument to the file whose name is the second command-line argum
Source Code/17-23.rs:5
Functionmain
It prints: text of the line */
Source Code/01-06.rs:4
Functionmain
It prints nothing. */
Source Code/23-06.rs:3
Functionmain
It prints: 37*/
Source Code/10-01.rs:3
Functionmain
It prints: 2 3 4 That is a sentence*/
Source Code/05-21.rs:3
Functionmain
It prints: 10000000, 183.19, Q*/
Source Code/08-01.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: non-primitive cast: `LargeNumber` as `SmallNumber` */
Source Code/20-12.rs:4
Functionmain
It prints: 0123456*/
Source Code/07-26.rs:3
Functionmain
The compiler prints the warning message: unused `Map` that must be used and then the note: iterators are lazy and do nothing unless consumed Then, the
Source Code/16-59.rs:7
Functionmain
It prints: text of the line */
Source Code/01-07.rs:4
Functionmain
The compiler prints the two warning messages: unused comparison that must be used unused arithmetic operation that must be used Then, the program prin
Source Code/07-04.rs:6
Functionmain
It prints nothing. */
Source Code/22-03.rs:3
Functionmain
It prints: 16775075 1234567 134023794 27121*/
Source Code/06-04.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: borrow of moved value: `s1` */
Source Code/22-09.rs:4
Functionmain
ILLEGAL. The compiler prints the error message: mismatched types with the explanation: expected `()`, found `u32` */
Source Code/06-34.rs:6
Functionmain
It prints: Hello, world!*/
Source Code/01-05.rs:3
Functionmain
()
Source Code/20-08.rs:15
Functionmain
It prints nothing. */
Source Code/04-09.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: use of moved value: `v1` */
Source Code/22-15.rs:4
Functionmain
It prints nothing. */
Source Code/05-27.rs:3
Functionmain
Source Code/22-13.cpp:5
Functionmain
In a 64-bit system, it prints: 8 8 8 8 In a 32-bit system, it prints: 4 4 4 4*/
Source Code/12-06.rs:5
Functionmain
ILLEGAL. The compiler prints the error message: unterminated block comment */
Source Code/01-15.rs:4
Functionmain
It prints nothing. */
Source Code/24-08.rs:3
Functionmain
It prints: ---------- ---------- ---------- */
Source Code/09-01.rs:6
Functionmain
It may print: 0 0 0 1 1 4 5 5 8 9 9 16 17 17 32 33 33 64 65 65 128 129 129 256 257 257 512 513 513 1024 */
Source Code/12-12.rs:13
Functionmain
()
Source Code/23-21.rs:5
Functionmain
It prints: 15 15 15*/
Source Code/09-33.rs:3
Functionmain
It prints: 4 10*/
Source Code/04-23.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: `n2` does not live long enough */
Source Code/23-25.rs:4
Functionmain
ILLEGAL. The compiler prints four times the error message: mismatched types once with the explanation: expected `i32`, found `bool` and the other time
Source Code/09-16.rs:8
Functionmain
If run with this command line in a Unix-like shell: ./main " first argument" "second argument " it prints: [./main][ first argument][second argument ]
Source Code/17-02.rs:11
Functionmain
ILLEGAL. The compiler prints the error message: not all trait items implemented, missing: `abs` */
Source Code/19-16.rs:4
Functionmain
It prints: [45, 12, 10, 8, 7, 4, 1, 0]*/
Source Code/13-07.rs:3
Functionmain
It prints: -2 45 ---*/
Source Code/16-46.rs:3
Functionmain
It prints: 10000000, 183.19, Q*/
Source Code/08-02.rs:3
Functionmain
It could print: 7.054µs 1.060243448s 1.02114628s*/
Source Code/21-03.rs:3
Functionmain
It prints: 8.2, 10*/
Source Code/08-10.rs:3
Functionmain
It prints: These are three lines */
Source Code/02-15.rs:6
Functionmain
It prints: 11 21 31 */
Source Code/16-10.rs:3
Functionmain
It prints: 7 7; 7 9 9*/
Source Code/11-07.rs:3
Functionmain
()
Source Code/06-20.rs:4
Functionmain
It prints: 80 + 34 = 114*/
Source Code/02-11.rs:3
Functionmain
It prints: [36, 1, 15, 9, 4]*/
Source Code/16-49.rs:3
Functionmain
ILLEGAL. The compiler prints the two error messages: explicit lifetime required in the type of `n` lifetime of reference outlives lifetime of borrowed
Source Code/23-17.rs:5
Functionmain
It prints: 13 12*/
Source Code/23-26.rs:3
Functionmain
ILLEGAL. The compiler prints twice the error message: explicit lifetime required in the type of `y` */
Source Code/23-23.rs:4
Functionmain
ILLEGAL. The compiler prints the error message: no method named `clone` found for struct `S` in the current scope */
Source Code/22-23.rs:4
Functionmain
It prints nothing. */
Source Code/06-30.rs:3
Functionmain
It prints: brave world */
Source Code/16-47.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: use of moved value: `v1` */
Source Code/22-14.rs:4
Functionmain
It prints nothing. */
Source Code/06-14.rs:3
Functionmain
It prints: [45, 12, 10, 8, 7, 4, 1, 0]*/
Source Code/13-06.rs:3
Functionmain
It prints many line, each having this pattern: [NAME]=[Value] Where NAME is the name of an environment variable, and Value is its current value. */
Source Code/17-05.rs:5
Functionmain
ILLEGAL. The compiler prints the error message: `x` does not live long enough */
Source Code/24-10.rs:4
Functionmain
()
Source Code/07-07.rs:4
Functionmain
Source Code/04-06.c:4
Functionmain
ILLEGAL. The compiler prints the error message: use of moved value: `s1` */
Source Code/22-17.rs:4
Functionmain
In a 64-bit system, it may print: 0x1 0 0 0x55f7d528f9d0 8 1 0x55f7d528f9d0 8 2 0x55f7d528f9d0 8 3 0x55f7d528f9d0 8 4 0x55f7d528f9d0 8 5 0x55f7d528f9d
Source Code/14-08.rs:21
Functionmain
It prints: [132, 86, 38]*/
Source Code/16-54.rs:3
Functionmain
It prints: [22, 33] [22, 0] [11, 22, 0, 44]*/
Source Code/15-20.rs:3
Functionmain
()
Source Code/10-11.rs:4
Functionmain
It prints nothing. */
Source Code/05-29.rs:3
Functionmain
In application code:
Source Code/24-15.rs:9
Functionmain
It prints: 10 16 8 2*/
Source Code/06-01.rs:3
Functionmain
It prints: 6 3*/
Source Code/19-20.rs:3
← previousnext →401–500 of 846, ranked by callers