Can you use a trait for that?
trait Database: Store + Logger {}
On Mon, Dec 1, 2014 at 11:48 AM, Philippe Daouadi blastro...@free.fr
wrote:
Hi,
In my project, I use something like:
struct Database {
db: BoxStore + 'static,
logger: BoxLogger + 'static,
}
Does anyone know what
On Tue, Nov 18, 2014 at 12:23 PM, Daniel Trstenjak
daniel.trsten...@gmail.com wrote:
Hi Steven,
On Tue, Nov 18, 2014 at 07:41:38PM +, Steven Fackler wrote:
The syntax is ambiguous:
let foo = (HashMapFoo, Barnew());
You mean 'let foo = (HashMapFoo, Bar::new());' , right?
Is
That doesn't seem to be what the compilation error says:
mut.rs:10:19: 10:20 error: use of moved value: `a`
mut.rs:10 println!({},a);
^
note: in expansion of format_args!
std macros:2:23: 2:77 note: expansion site
std macros:1:1: 3:2 note: in expansion of println!
On Tue, Feb 18, 2014 at 11:52 PM, Phil Dawes rustp...@phildawes.net wrote:
Is that not a big problem for production code? I think I'd prefer the
default case to be to crash the task than deal with a logic bug.
The existence of library functions that swallow errors makes reviewing
code and
Fantastic! Good luck, Nick!
On Mon, Feb 3, 2014 at 6:51 PM, Alex Crichton a...@crichton.co wrote:
Welcome Nick!
I can't wait to see that 1.0 issue count go down!
On Mon, Feb 3, 2014 at 6:20 PM, Brian Anderson bander...@mozilla.com
wrote:
Hi Rusties,
I'm just thrilled to announce
On Sat, Feb 1, 2014 at 3:06 PM, Benjamin Striegel ben.strie...@gmail.comwrote:
Another point in favor of this plan is that it would eliminate the need to
put type parameters directly after the `impl`, which to be honest *is*
pretty weird and inconsistent with the rest of the language. But I'm
On Sun, Dec 1, 2013 at 8:04 AM, spir denis.s...@gmail.com wrote:
On 12/01/2013 02:51 AM, Florian Zeitz wrote:
If I may chime in here.
I agree with Kevin that the different semantics of `new` are more likely
to create confusion, than alleviate it.
Personally I would suggest calling this
This strikes me as a good point. I think the incongruity this would create
between functions and methods -- along with the additional syntactic burden
-- could lead to the use of functions feeling second class in some sense.
Also, how would static methods be treated?
Cheers,
Tim
On Wed, Nov 20,
Instead of `do spawn` try `do spawn_with(s) |s| { ... }`. Then the closure
won't close over s, but rather take it as an argument, allowing it to move
it out.
Cheers
On Sat, Nov 2, 2013 at 5:05 PM, Leah Hanson astriea...@gmail.com wrote:
Thanks, Brendan. :)
You’re trying to move the ~strs
simplification
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary7823106168118235853==
--===7823106168118235853==
Content-Type: multipart/alternative;
boundary=4SVSQE8L3ECYN7Z8RACUF07S828YYG
--4SVSQE8L3ECYN7Z8RACUF07S828YYG
Content-Type: text/plain;
To make it a fair fight, I converted the Go and C++ versions to trace
Rust instead. These are my results on my Macbook Pro:
=== RUST ===
$ rustc -O bin.rs
$ time ./bin rrays.ppm
real 0m14.472s
user 0m14.102s
sys 0m0.365s
=== GO ===
$ go build main.go
$ time ./main grays.ppm
real 0m13.928s
curious if currently we make any
distinction at all between opt levels 2 and 3.
Also, what version of Rust? I believe our support for
LLVM-SIMD-vectorization-pass voodoo only landed recently.
On Tue, Sep 24, 2013 at 2:13 PM, Tim Kuehn tku...@cmu.edu wrote:
To make it a fair fight, I
There's also std::iter::AdditiveIterator.
fn averageT: Num + NumCast + Clone(values: [T]) - T {
let sum = values.iter().map(|n| n.clone()).sum();
sum / num::cast(values.len())
}
On Tue, Sep 24, 2013 at 7:36 PM, Brendan Zabarauskas bjz...@yahoo.com.auwrote:
I normally prefer using
13 matches
Mail list logo