Hi,
Consider these two examples:
1)
let mut file = File::open(filename);
file.read(buf);
2)
let file = File::open(filename);
let mut reader = BufferedReader::new(file);
reader.read(buf);
My question is: in example 2, why doesn't BufferedReader need file to
be mutable? After all,
On 2014-07-21 03:33, Patrick Walton wrote:
On 7/20/14 6:29 PM, David Henningsson wrote:
Hi,
Consider these two examples:
1)
let mut file = File::open(filename);
file.read(buf);
2)
let file = File::open(filename);
let mut reader = BufferedReader::new(file);
reader.read(buf);
My question
errors in users of that
library that expected the other type. But if the compiler is guaranteed
to catch all such errors even with today's handling, maybe that is not
too much to worry about.
On Sun, Jul 20, 2014 at 7:39 PM, David Henningsson di...@ubuntu.com
mailto:di...@ubuntu.com wrote
On 2014-07-21 06:06, Patrick Walton wrote:
On 7/20/14 9:04 PM, Patrick Walton wrote:
On 7/20/14 8:12 PM, David Henningsson wrote:
Cool, thanks for the answer. These restrictions seem somewhat complex.
They are required. Otherwise we would end up with a C++-like situation
where copies end
On 2014-07-21 19:17, Patrick Walton wrote:
On 7/21/14 8:49 AM, Tobias Müller wrote:
Patrick Walton pcwal...@mozilla.com wrote:
On 7/20/14 8:12 PM, David Henningsson wrote:
From a language design perspective, maybe it would be more
intuitive to
have different syntaxes for copy and move
On 2014-07-24 16:30, Kevin Ballard wrote:
On Wed, Jul 23, 2014, at 12:52 PM, David Henningsson wrote:
On 2014-07-21 19:17, Patrick Walton wrote:
On 7/21/14 8:49 AM, Tobias Müller wrote:
Patrick Walton pcwal...@mozilla.com wrote:
On 7/20/14 8:12 PM, David Henningsson wrote:
From
Hi,
I'm curious about the possibilities to use Rust for programming
real-time audio stuff. Usually one has one small task that runs in high
priority, and everything else is handled by a main task.
I have a few questions related to this:
1) The real-time audio task should never block when
as such? And then one could have a
warning in case one uses such an item.
On Wed, Oct 8, 2014 at 1:49 AM, David Henningsson di...@ubuntu.com
mailto:di...@ubuntu.com wrote:
Hi,
I'm curious about the possibilities to use Rust for programming
real-time audio stuff. Usually one has one
On 2014-10-08 07:49, David Henningsson wrote:
Hi,
I'm curious about the possibilities to use Rust for programming
real-time audio stuff. Usually one has one small task that runs in
high priority, and everything else is handled by a main task.
I have a few questions related to this:
1
On 2014-10-08 07:49, David Henningsson wrote:
Hi,
I'm curious about the possibilities to use Rust for programming
real-time audio stuff. Usually one has one small task that runs in
high priority, and everything else is handled by a main task.
I have a few questions related to this:
1
This is probably a previously asked question, but I couldn't find it on
Google, so...
Let's extend the Circle example from the guide a little:
struct Circle {
x:f64,
y:f64,
radius:f64,
}
trait HasArea {
fn area(self)- f64;
}
impl HasArea for Circle {
fn
as_mut_circle(mut self) - mut Circle { mut self.circle }
}
The compiler will optimize trivial functions, except cross-crate. In
those cases, use an #[inline] annotation.
On Thu, Oct 16, 2014 at 10:57 PM, David Henningsson di...@ubuntu.com
mailto:di...@ubuntu.com wrote:
This is probably
it in C.
Regards,
- Clark
On Fri, Oct 17, 2014 at 4:27 AM, David Henningsson di...@ubuntu.com
mailto:di...@ubuntu.com wrote:
Hmm, right. The as_* could probably useful to write a macro for.
Coming from the C/Java side of things I have to figure out how this
works in a bigger
it - in your enum example, you need to say
Bag'a (for some defined 'a). For example, Bag'static means the
pointed-to data lives as long as the program.
On Fri, Oct 17, 2014 at 11:50 AM, David Henningsson di...@ubuntu.com
mailto:di...@ubuntu.com wrote:
Thanks for the answer. Deref is a new one
Hi,
So, I was trying to make a digraph where every node and edge has a
property list (which can change during the lifetime of the node/edge),
and I ended up with this structure:
struct Edge {
from_node: WeakRefCellNode,
to_node: WeakRefCellNode,
prop_list: HashMapString, String,
Hi,
I'm wondering if external crate declarations from modules are
discouraged in general? Because things seem to become a bit quirky, took
me a while to grasp:
First, use starts at the root whereas everything else starts at the
current module. E g, imagine a test_seri.rs file which looks
);
}
}
--
Sincerely,
Vladimir Farcaller Pouzanov
http://farcaller.net/
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
);
}
}
--
Sincerely,
Vladimir Farcaller Pouzanov
http://farcaller.net/
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
18 matches
Mail list logo