This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cbzehner at MacBook-Pro-4 ~/Projects/pull-requests/rust/exercises/nth-prime [SUCCESS] | |
$cargo test | |
Compiling nth_prime v1.0.0 (file:///Users/cbzehner/Projects/pull-requests/rust/exercises/nth-prime) | |
Finished dev [unoptimized + debuginfo] target(s) in 0.81 secs | |
Running target/debug/deps/nth_prime-94d2e6fce3eb8601 | |
running 0 tests | |
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cbzehner at MacBook-Pro-4 ~/Projects/pull-requests/rust/exercises/gigasecond [SUCCESS] | |
$cargo check | |
Compiling gigasecond v1.1.0 (file:///Users/cbzehner/Projects/pull-requests/rust/exercises/gigasecond) | |
error[E0412]: cannot find type `Utc` in this scope | |
--> src/lib.rs:6:30 | |
| | |
6 | pub fn after(start: DateTime<Utc>) -> DateTime<Utc> { | |
| ^^^ not found in this scope | |
help: possible candidates are found in other modules, you can import them into scope | |
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let r = 2; | |
{ | |
let x = 5; | |
let r = x; | |
} | |
println!("r: {}", r); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn largest<T: PartialOrd>(list: &[T]) -> &T { | |
let mut largest = &list[0]; | |
for ref item in list.iter() { | |
if *item > largest { | |
largest = item; | |
} | |
} | |
largest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cargo run | |
Compiling slice_test v0.1.0 (file:///Users/cbzehner/Projects/rust/slice_test) | |
Finished dev [unoptimized + debuginfo] target(s) in 0.71 secs | |
Running `target/debug/slice_test` | |
thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside '🦀' (bytes 0..4) of `🦀 is 🔥`', src/libcore/str/mod.rs:2234:5 | |
note: Run with `RUST_BACKTRACE=1` for a backtrace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let rust = String::from("🦀 is 🔥"); | |
let split_crab = &rust[1..]; | |
println!("{}", split_crab); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Files | |
( getFilesRecursively | |
) where | |
import System.Directory (doesDirectoryExist, doesFileExist, listDirectory) | |
import System.Exit | |
import System.FilePath (combine) | |
data PathType = Directory | File | Invalid | |
deriving (Eq, Ord, Show, Enum) |
NewerOlder