The `nums` array is allocated on the stack and is 8 MB (assuming you're on
a 64 bit platform).
On Wed Nov 26 2014 at 8:23:08 PM Ben Wilson benwilson...@gmail.com wrote:
Hey folks, I've started writing some rust code lately and run into weird
behavior when benchmarking. When running
The syntax is ambiguous:
let foo = (HashMapFoo, Barnew());
is foo a HashMapFoo, Bar, or is it a tuple containing the results of
these two comparisons: HashMap Foo and Bar new()?
On Tue Nov 18 2014 at 1:38:26 PM Daniel Trstenjak
daniel.trsten...@gmail.com wrote:
Dear rust devs,
is there
{
do_bar();
}
```
is equivalent to
```
loop {
if !thing {
break;
}
do_bar();
}
```
We judged that the convenience of the `if let` syntax justified its
inclusion in the language, just like `for` and `while`.
Steven Fackler
On Tue, Oct 14, 2014 at 8:40 AM, Michael
`if let` acts on *any* refutable pattern, not just `Option`s. The RFC that
proposed the syntax is a good place to look for the rationale of why it was
added: https://github.com/rust-lang/rfcs/pull/160
Steven Fackler
On Sun, Oct 12, 2014 at 10:41 PM, Michael Giagnocavo m...@giagnocavo.net
wrote
{ a: int, b: 'static str }).
In addition, if a type implements Drop, it is no longer Copy.
Steven Fackler
On Sun, Jul 20, 2014 at 7:39 PM, David Henningsson di...@ubuntu.com wrote:
On 2014-07-21 03:33, Patrick Walton wrote:
On 7/20/14 6:29 PM, David Henningsson wrote:
Hi,
Consider these two
saying that if you *do* want to visit everything, you have
to manually check to make sure you're overriding everything.
Steven Fackler
On Wed, Jul 16, 2014 at 11:59 AM, Christoph Husse
thesaint1...@googlemail.com wrote:
This comment from syntax::visit::Visitor really gives me a headache
given the compiler an
opportunity to use it!
Steven Fackler
On Wed, Jul 16, 2014 at 5:16 PM, Ben Harris m...@bharr.is wrote:
Have a quick skim over this (
http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/).
Lint is the last thing to run before conversion to LLVM.
I'f you
There's a fix for make install waiting on bors right now:
https://github.com/rust-lang/rust/pull/15550
Steven Fackler
On Wed, Jul 9, 2014 at 1:11 PM, Ben Gamari bgamari.f...@gmail.com wrote:
Brian Anderson bander...@mozilla.com writes:
Hi.
Very soon now the way rustc links crates
to the Database
instead.
Steven Fackler
On Tue, Jul 1, 2014 at 7:35 AM, David Brown dav...@davidb.org wrote:
Imagine a hypothetical database interface:
struct Database { ... }
struct Cursor'a {
db: 'a Database,
...
}
impl Database {
fn query'a('a self
/
mod.rs
bar/
mod.rs
The first configuration seems to be what most code uses. If bar ends up
having submodules of its own, it would need to move to the second setup.
Steven Fackler
On Sun, Jun 1, 2014 at 3:02 PM, Nicholas Bishop nicholasbis...@gmail.com
wrote
Yep!
main.rs:
mod foo;
mod bar;
fn main() {
foo::foo();
}
foo.rs:
use bar; // this use lets you refer to the bar fn as bar::bar() instead of
::bar::bar()
pub fn foo() {
bar::bar();
}
bar.rs:
pub fn bar() {}
Steven Fackler
On Sun, Jun 1, 2014 at 5:25 PM, Nicholas Bishop
It may not fulfill your exact use case, but you can get this in a way:
let mut foo = bar.iter().peekable();
{
let mut limit_foo = foo.by_ref().limit(50);
for baz in limit_foo {
...
}
}
if foo.is_empty() {
...
}
Steven Fackler
On Fri, May 30, 2014 at 9:51 AM, Evan G eg1
Type annotations are not there for the compiler; they're there for people
reading the code. If I want to use some function I don't want to be forced
to read the entire implementation to figure out what the lifetime of the
return value is.
Steven Fackler
On Thu, May 15, 2014 at 9:30 PM, Tommi
That will be possible, but the Index trait needs to be overhauled first.
Steven Fackler
On Sun, May 4, 2014 at 3:01 PM, Brian Rogoff brog...@gmail.com wrote:
On Sat, May 3, 2014 at 2:27 AM, Artella Coding
artella.cod...@googlemail.com wrote:
Hi looking at https://github.com/rust-lang/rfcs
crashing. Adjusting the struct definition to
struct StateMachineIter {
statefn: fn(mut StateMachineIter) - Option'static str
}
should make things work as you want. There's also a bug in rustc for even
letting that program compile. I'm not sure if it's already been run into
and filed.
Steven
You can use task::try(...).ok().unwrap() for Results with non-Show error
types.
Steven Fackler
On Thu, Apr 17, 2014 at 8:55 AM, Edward Wang edward.yu.w...@gmail.comwrote:
It current can compile, but judging from signatures:
std::task::try is pub fn tryT: Send(f: proc(): Send - T) - ResultT
You can do it like this:
implT: Writer MySerialization for T {
...
}
Steven Fackler
On Sat, Apr 5, 2014 at 12:57 PM, Frank Huang m...@nongraphical.com wrote:
Hello everyone,
I have a question about making extension methods on something like
io::Writer. Basically, I have a data format
println is a function in std::io that prints strings to standard out.
println! is a macro that allows for formatted output (e.g. println!(hello,
{}!, world)). More details here:
http://static.rust-lang.org/doc/master/std/fmt/index.html
Steven Fackler
On Fri, Mar 14, 2014 at 2:52 PM, Renato
The Zen of Python also says There should be one-- and preferably only one
--obvious way to do it.
Steven Fackler
On Thu, Jan 30, 2014 at 11:35 AM, Donaldo Fastoso
donquest...@rocketmail.com wrote:
I like python's rational of consenting adults: Give people the tools
to do the right thing
and it's unclear whether or not that's a good idea.
Steven Fackler
On Thu, Jan 23, 2014 at 8:32 PM, benjamin adamson
adamson.benja...@gmail.com wrote:
Question, what constitutes whether a 'trait' is applicable for
implementation by the #deriving() attribute?
According to the language
Something like this should work:
pub fn cell_alive(self, Row(row): Row, Column(column): Column) - uint {
return match self.inner[row][column].value {
dead = 0,
alive = 1
};
}
Steven Fackler
On Sat, Jan 11, 2014 at 2:03 PM, benjamin adamson
adamson.benja...@gmail.com wrote
There's an old open PR to optionally integrate with rust-ssl or rust-nss (
https://github.com/chris-morgan/rust-http/pull/31) but it'd need to be
updated.
Steven Fackler
On Sun, Dec 29, 2013 at 10:12 AM, Patrick Walton pcwal...@mozilla.comwrote:
On 12/29/13 7:48 AM, Erick Tryzelaar wrote
just to push the APIs of different SQL client
libraries closer together.
Someone could absolutely take the interface used by rust-postgres and make
a MySQL/MariaDB driver with it, but that person wouldn't be me :)
Steven Fackler
On Wed, Dec 11, 2013 at 7:15 AM, Gaetan gae...@xeberon.net wrote:
I
encoded data
into a URL you're going to have to use URL_SAFE instead of STANDARD. If
you're trying to send an email, you'll need to use MIME instead of
STANDARD. If you're talking to a service that requires one of the ~10 other
variants of Base64, you'll need to use a custom config struct.
Steven Fackler
If T is a trait, its trait objects ~T, @T and T do not implement T. There
is an implementation of Writer for @Writer, but not for ~Writer or Writer
which is why you're seeing that error.
Steven Fackler
On Fri, Oct 18, 2013 at 11:27 PM, Oren Ben-Kiki o...@ben-kiki.org wrote:
Ugh, I was too
it into a new ~str. In the IO case, you could keep this cost free to
implement by having `Reader` contain a default implementation for `read`
and only require users to implement `try_read`. See
http://docs.octayn.net/postgres/struct.PostgresConnection.html for some
examples.
Steven Fackler
if we replace self.bar or
self.bar.baz.
Steven Fackler
On Sun, Sep 29, 2013 at 3:15 PM, Tim Kuehn tku...@cmu.edu wrote:
Could you use struct methods for quick access? Or is there a reason this
wouldn't fit your use case? Sorry, I haven't followed the whole thread
closely.
struct Owner
27 matches
Mail list logo