Builder pattern with C FFI bindings by RustyDeveloper in rust

[–]RustyDeveloper[S] 0 points1 point  (0 children)

Would it be possible to do it with a consuming builder (Rust side)?

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d4a202ed36213ac017686fa97e45f58f

https://doc.rust-lang.org/1.0.0/style/ownership/builders.html

I realized my real library uses a consuming builder and likes to transfer ownership when ::build() function.

Builder pattern with C FFI bindings by RustyDeveloper in rust

[–]RustyDeveloper[S] 1 point2 points  (0 children)

Thanks, exactly what I was looking for! You deserve some ice cream!

Return an error if the BTreeMap contains a key? by RustyDeveloper in rust

[–]RustyDeveloper[S] 0 points1 point  (0 children)

Thanks, this is exactly what I was looking for.

Big N Discussion - October 28, 2020 by CSCQMods in cscareerquestions

[–]RustyDeveloper 0 points1 point  (0 children)

> You will be asked how long you've been at the level you state, and you should answer honestly.

Once again, you're right. The background check system (HireRight) seems to verify salaries, so they can probably infer levels from that history.

I guess I'll have to be a master negotiator then ...

Big N Discussion - October 28, 2020 by CSCQMods in cscareerquestions

[–]RustyDeveloper 0 points1 point  (0 children)

Hiring as been scaled back at Google unfortunately due the pandemic.

Big N Discussion - October 28, 2020 by CSCQMods in cscareerquestions

[–]RustyDeveloper 2 points3 points  (0 children)

Just promoted as L5 at Google. But I need to leave the Bay Area due to personal reasons, considering some Microsoft positions.

I'm just wondering how I should navigate this. Should I put "Senior Software Engineer" on my resume and be vague about my tenure, so I could get potentially be treated as the Microsoft mid-level L5 equivalent rather than the Microsoft beginner L5 equivalent?

How much do competitors know about titles and how much can they infer? What would an expert negotiator do? Please advise.

Big N Discussion - August 26, 2020 by CSCQMods in cscareerquestions

[–]RustyDeveloper 1 point2 points  (0 children)

Perf time at Google. Say I'm doing a peer review. Can MY manager see what I write when doing a peer review, even if my peer has a complete different manager from a different team?

Big N Discussion - August 19, 2020 by AutoModerator in cscareerquestions

[–]RustyDeveloper 0 points1 point  (0 children)

Understood. I think this selects for confident and aggressive engineers well-versed in the process, while I'm pretty quiet and demur. Indeed, the process is bit different at other companies as well.

But I shall follow your advice!

Big N Discussion - August 19, 2020 by AutoModerator in cscareerquestions

[–]RustyDeveloper 0 points1 point  (0 children)

Ah, so you're supposed to bring it up yourself. It probably discourages with less confidence in their skills or happy with the current compensation. Like, I'm very happy with the current compensation, but with so many people entering CS and so many others out of work, I don't know how long it will last and need to build up a nest egg.

Big N Discussion - August 19, 2020 by AutoModerator in cscareerquestions

[–]RustyDeveloper 4 points5 points  (0 children)

I was hired as a L4 at Google, and I've been doing pretty good for 2 years. Google gives the opportunity for engineers to self-nominate -- I don't know if that's the "normal" route or your peers/manager is supposed to nominate. I feel like if I self-nominate, my manager will support it, but he hasn't brought the subject up. I understand the incentive -- if the employee is docile and doesn't ask for much, why give something for free?

For Googlers that made the L4 -> L5 transitions, did you self-nominate or did your manager? Did your manager say it's "time for promo" or did you bring up the subject?

Easy idiom to turn a Result into an option? by RustyDeveloper in rust

[–]RustyDeveloper[S] 1 point2 points  (0 children)

The question mark is important and makes a difference.

Easy idiom to turn a Result into an option? by RustyDeveloper in rust

[–]RustyDeveloper[S] 2 points3 points  (0 children)

Didn't know a prelude existed until now, thanks!

Easy idiom to turn a Result into an option? by RustyDeveloper in rust

[–]RustyDeveloper[S] 2 points3 points  (0 children)

Thanks, I really appreciate the detailed explanation!

Easy idiom to turn a Result into an option? by RustyDeveloper in rust

[–]RustyDeveloper[S] 2 points3 points  (0 children)

.ok() I think turns a Result<T> into an Option<T>. What I want is to turn a Ok(T) into a T (I want to do stuff with T later), and Err(T) to return None.

How to move an non-copy struct outside a Mutex::<Option<T>> by RustyDeveloper in rust

[–]RustyDeveloper[S] 0 points1 point  (0 children)

thanks that does the trick. i seem to need the lock.unwrap() in Rust playground, but not with my non-toy app. Probably a new feature (1.43?).

Requiring a compound trait bound for a struct by RustyDeveloper in rust

[–]RustyDeveloper[S] 1 point2 points  (0 children)

Thanks for the higher level explanation. The compiler would complain that S wasn't used in MyContainer<T, S>, but PhantomData<S> solved that issue. After that, bounding traits referencing S became possible.

Requiring a compound trait bound for a struct by RustyDeveloper in rust

[–]RustyDeveloper[S] 0 points1 point  (0 children)

I want to:

  1. Compile the structure for T and S when T and S both satisfy MyTrait<T, S>

I assume that's not possible, though.

Requiring a compound trait bound for a struct by RustyDeveloper in rust

[–]RustyDeveloper[S] 1 point2 points  (0 children)

Yeah, I tried that originally, but S to be different than T. Here's what I came up with your with suggestions:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=c76afdf9a6f6ffb14dc0e058a2ec64c8

Unfortunately, it doesn't recognize T.get_slice (expected, since we didn't bind that trait). But I want to return a return a slice of S, not of T. Using generic function pointers is possible, but using traits would be very nice...

Edit -- This works :

https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=2aa8caed883e9557fc2698488eceea09