-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Description
First portion of the tutorial has us doing:
extern crate semver;
use semver::Version;
fn main() {
assert!(Version::parse("1.2.3") == Ok(Version {
major: 1u,
minor: 2u,
patch: 3u,
pre: vec!(),
build: vec!(),
}));
println!("Versions compared successfully!");
}
results in a failed compile:
/home/clayton/rust/tutorial/hello_world/src/main.rs:7:16: 7:18 error: mismatched types: expected `u64`, found `usize` (expected u64, found usize)
/home/clayton/rust/tutorial/hello_world/src/main.rs:7 major: 1u,
^~
Trying the suggested fix per compiler:
/home/clayton/rust/tutorial/hello_world/src/main.rs:7:16: 7:19 error: mismatched types: expected `u64`, found `usize` (expected u64, found usize)
/home/clayton/rust/tutorial/hello_world/src/main.rs:7 major: 1us,
^~~
However, per a post on reddit/r/rust/ it was suggested that I try u64 instead, which works.
Metadata
Metadata
Assignees
Labels
No labels