--- Log opened Mon Apr 08 00:00:39 2019 00:16 -!- ccdle12 [~ccdle12@061092247118.ctinets.com] has quit [Remote host closed the connection] 00:41 -!- CubicEarth [~CubicEart@c-73-181-185-227.hsd1.wa.comcast.net] has quit [Ping timeout: 250 seconds] 01:10 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 01:14 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 01:19 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 258 seconds] 01:34 -!- ccdle12 [~ccdle12@223.197.182.203] has joined #rust-bitcoin 01:37 -!- TamasBlummer1 [~Thunderbi@p200300DD670F9D096506B7C4D522E0CB.dip0.t-ipconnect.de] has joined #rust-bitcoin 01:37 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 01:37 -!- TamasBlummer [~Thunderbi@p200300DD670F9D686506B7C4D522E0CB.dip0.t-ipconnect.de] has quit [Ping timeout: 264 seconds] 01:37 -!- TamasBlummer1 is now known as TamasBlummer 01:41 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 02:11 < stevenroose> dpc: here? 02:26 -!- CubicEarth_ [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 02:28 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Ping timeout: 268 seconds] 02:33 -!- ccdle12 [~ccdle12@223.197.182.203] has quit [Read error: Connection reset by peer] 02:33 -!- ccdle12 [~ccdle12@223.197.182.203] has joined #rust-bitcoin 02:37 -!- ccdle12 [~ccdle12@223.197.182.203] has quit [Remote host closed the connection] 03:54 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 03:58 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 264 seconds] 06:14 < stevenroose> The Rust compiler suggests using `to_string()` to convert a &str to a String. If &str's `to_string()` comes from fmt::Display, isn't that unecessary overhead over just using `to_owned()`? 06:14 < stevenroose> (also to_owned() is one character shorter to type) 06:18 < andytoshi> i think `to_string()` is a generic message for everything that impls Display/ToString 06:18 < andytoshi> and `to_owned` actually is more efficient 07:10 < wumpus> I seem to remember from some discussion on the rust forums that they have the same implementation in practice, but yes, to_string might do other things for other types, so to_owned is more specific 07:32 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 07:37 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 07:45 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 256 seconds] 07:50 < stevenroose> andytoshi: yeah that's what I thought 07:51 < stevenroose> Also andytoshi, bumped into an inconvenience with jsonrpc: In our project we are using Hyper (latest) and I want to catch a specific Hyper error in order to do a retry. Does't seem possible. I can't use two different version of hyper and the error types don't match of course. 07:52 < stevenroose> Not sure how to solve this. I could keep using std::error::Error::cause so that I don't have to use the hyper error error definition and can go straight to the inner std::io error 07:54 < stevenroose> Meh, using cause is super inconvenient. You're getting a &std::error::Error from that. Can't inspect that in any way except for the description. 07:55 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 07:57 < stevenroose> wumpus: yeah that's why I asked specifically to 07:57 < stevenroose> "&str's to_string". They might have overwritten the default impl to just return to_owned. 08:29 < wumpus> stevenroose: IIRC .into() is also an option that's even shorter 08:45 < stevenroose> wumpus: true, or format!( and in some cases that makes it more consistent with times where you need to add extra formatting, like adding info strings to error cases etc 08:45 < stevenroose> but yeah .into() is shortest 08:46 < dpc> stevenroose? 08:46 < andytoshi> i think `format!("{}", x)` will probably actually compile into the same code as .to_string() 08:46 < wumpus> andytoshi: I think so too 08:47 < wumpus> (esp. in release mode) 08:48 < stevenroose> andytoshi: yeah my argument there was for static strings. If you have errors where you have "incorrect value".into() and other times format!("incorrect value: {}" val), then it's more consistent to just use format!("incorrect value") for the argument-less strings as well 08:49 < stevenroose> but now were into the weeds of things that are most probably optimized away by the compiler 08:53 < andytoshi> yeah. i wouldn't nit a PR that used format!("static string") if it was clearly for consistency 08:53 < andytoshi> i can't imagine that being any less efficient than using .into() or whatever 09:04 < wumpus> I think if efficiency is of the utmost importance, the API should take str& and not string, it's more general 09:04 < wumpus> (though if the string is going to be cloned and consumed internally I suppose it makes no difference) 09:06 -!- willpier_ [~willpiers@38.75.231.30] has joined #rust-bitcoin 09:06 -!- willpiers [~willpiers@38.75.231.30] has quit [Read error: Connection reset by peer] 09:24 < wumpus> stevenroose: I've run into the same kind of problems, can be kind of annoying when libraries don't provide access to the inner error 09:30 -!- neonknight0 is now known as neonknight 09:30 -!- neonknight is now known as neonknight64 09:49 < stevenroose> wumpus: yeah in the end I just settled for `e.cause().map(|e| e.to_string()).unwrap_or_default() == "Preprogrammed error message"` sub-optimal, but bleh 10:04 < andytoshi> you could just use `e.to_string()` and check that, no? 11:11 -!- willpier_ [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 11:41 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 11:47 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 11:48 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 11:52 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 255 seconds] 12:35 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 13:41 < stevenroose> andytoshi: with the string prefix? yeah I could have done that.. :D 13:43 < andytoshi> yeah :) 15:11 -!- CubicEarth_ [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 15:14 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 15:36 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Read error: Connection reset by peer] 16:43 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 18:14 < ariard> BlueMatt: hey back, writing fee stuff, really available this week to push things forward :) 18:59 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 20:39 < BlueMatt> ariard: heyhey, yea, getting back into the swing of things this week....sorry last week was.....not exactly the most productive 21:00 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 21:05 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 268 seconds] 21:32 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin --- Log closed Tue Apr 09 00:00:39 2019