« first day (1626 days earlier)      last day (1849 days later) » 

2:14 AM
w
t
f
-1
Q: How to return impl trait wrapped inside Result?

ListeroneI have a function that reads in some content either from a file or from the web, and returns the contents. For simplicity, let's use the following which is just for a file: fn test() -> Result<Vec<u8>, Error> { let mut buf = Vec::new(); // Does some things that may error ... File::op...

OP is really going for the "shows no research effort" vote
 
 
3 hours later…
5:33 AM
@Shepmaster you're a little harsh on this one. The question seems acceptable to me. Making sense of the type system can take some time given the state of the various documentations.
 
5:52 AM
Browsing and searching online a specific branch of a GH repository is horrible. The screen almost never tells you on what branch you are
 
6:02 AM
If I use a specific branch of a crate, cargo doc still serves the master branch. It's a bug, right ?
 
6:27 AM
@DenysSéguret maybe rebuild it ?
 
6:53 AM
In fact the problem seems to be that cargo builds an invalid URL for the branch (one that is not correctly interpreted by GH).
Gosh... There's nothing in the doc regarding branches on cargo for GH... only 50 different answers in forums and SO
Isn't this how you're supposed to specify the branch ?
[dependencies]
crossterm = { git = "https://github.com/TimonPost/crossterm", branch = "input_handling" }
 
@DenysSéguret yes
 
 
2 hours later…
9:08 AM
This question is very popular and useful but badly formatted. Any volunteers? ^^
 
 
2 hours later…
10:57 AM
put 400g instead of 200g of pasta
my stomach is full
 
400g just for you ?
 
I generally eat once a day
but not 400g XD
 
You're less than 30yo, right ?
 
11:33 AM
3 minutes... -2 okkkkkkkkkkkkkkkkkk
 
I don't get his idea... how is parallelizing supposed to work here?
 
I don't see too
 
Several threads doing a split_whitespace of the same string ?
a step is missing
100% of the parallelized task needs to take the ownership of either the buffer or the hashmap
A solution could be to use several hashmap and merge them later. Or to split the buffer in several parts before. But this is off-topic
 
11:54 AM
I don't think you win anything by doing that
 
yes, it's completly useless here
 
Remove the Arc on the input string and it works. (Untested)
> To simplify the code I removed string chunking and only spawn 1 thread within the for loop.
 
 
2 hours later…
1:45 PM
Don't build an Arc unless you expect a flood (of borrows).
 
 
2 hours later…
3:21 PM
I will try to ignore the 3 last questions
also what was the chance of 3 database question, and all bad one
 

« first day (1626 days earlier)      last day (1849 days later) »