Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Add this tag to your question to indicate that you are new to the language of your code. This will often be taken into consideration by reviewers when assessing your code.
3
votes
Accepted
A simple implementation of the Unix find command written in Rust
Your code can be simplified a little bit:
use std::collections::VecDeque;
use std::ffi::{OsStr, OsString};
use std::io;
use std::path::PathBuf;
fn find(query: &str, start: &OsStr) -> io::Result<Vec< …
3
votes
Rust, compute gcd: modularity, references
You do not need to take the numbers by reference.
Do not put an underscore at the beginning of the variable name. A variable name beginning with _ is used to say to the compiler that the variable is …
2
votes
Accepted
Summation Over Lines in a File (Advent of Code 2018 Day 1)
That's how you use Iterator::sum:
use std::fs::File;
use std::io::{self, prelude::*, BufReader};
fn main() -> io::Result<()> {
let file = File::open("day01.txt")?;
let reader = BufReader::ne …
3
votes
Greedy Best First Search implementation in Rust
I will post comments not about your performances, but about your writing style, because some things can be shortened.
Simplify vector creation:
let mut path = Vec::new();
path.push(root);
can be w …