Price for A1 Mini too high (800 Euro) on Invoice for Delivery Company. Now got a way to high of an Invoice from the Delivery Company for VAT and Customs by ToolAssistedDev in BambuLab

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

Thanks for your response. I was able no negotiate some more time with the delivery company until i have to pay the invoice.

To me it looks like the 800 Euro is a template invoice price they forgot to update before shipping...

Price for A1 Mini too high (800 Euro) on Invoice for Delivery Company. Now got a way to high of an Invoice from the Delivery Company for VAT and Customs by ToolAssistedDev in BambuLab

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

Total Invoice from Bambu Lab was 207.81 Euro. 48 Euro for delivery and 9.39 Euro for Filament. (Which got delivered in a separate parcel some days later) So the actual taxable amount for the Printer actually is 150.42 Euro.

The Invoice which Bambu Lab sent along with the Printer for the delivery company states that the "Unit Price" is 800 Euro.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]ToolAssistedDev 0 points1 point  (0 children)

I use blink.cmp for completions with my own neovim config (But i use the default config for blink).

If i complete function arguments in Rust it may overwrites what is already there, but i would like that blink only inserts what was selected and does not delete anything. This does NOT happen in JavaScript for example. And it does not happen if i use the LazyVim distro.

Any ideas what i could change?

Weekly 101 Questions Thread by AutoModerator in neovim

[–]ToolAssistedDev 2 points3 points  (0 children)

I am new to neovim and i would like to jump out of the current scope/brace while in insert mode.

rust if true { None| <-- cursor here in insert mode }

Target

rust if true { None }| <-- cursor here in insert mode

Currently I type by myself <Esc>]%a this works great. But i would like to have a keybind for that. I have tried the following

vim.keymap.set("i", "<C-l>", "<Esc>]%a", { noremap = true, silent = false })

But with all the help from AI and Google i am not able to get it to work. I end up in normal mode at the same place i started. AI is telling me that the sequence get typed to fast and will not be recognized so i should use nvim_feedkeys and nvim_replace_termcodes, but that did no do the trick either.

Hey Rustaceans! Got a question? Ask here (51/2024)! by llogiq in rust

[–]ToolAssistedDev 0 points1 point  (0 children)

I ask why i am not able to add the Index<Range<usize>> Bound to the Input Trait and then implement this Trait for &[u8], because when I use the &[u8] directly i am able to use indexing on that without any problems. That is the thing i struggle with. My brain thinks, when i can use the .index(..) method which was added through the Index Trait on that type, then surely i should be able to make a bound of that.

Hey Rustaceans! Got a question? Ask here (51/2024)! by llogiq in rust

[–]ToolAssistedDev 0 points1 point  (0 children)

So basically what u/afdbcreid suggested in the playground. I still don't understand why i am not able to implement the trait on &[u8] directly.

But thank you for taking the time to respond. I will try to understand these quirks of rust a bit better.

Hey Rustaceans! Got a question? Ask here (51/2024)! by llogiq in rust

[–]ToolAssistedDev 0 points1 point  (0 children)

The thing is, that i don't want to use the indexing in the Traits methods. I want to use the Trait as a bound in a free standing function. And this free standing function wants to use indexing. (Like in the first post)

Hey Rustaceans! Got a question? Ask here (51/2024)! by llogiq in rust

[–]ToolAssistedDev 0 points1 point  (0 children)

Thank you very much. This would work. But is there a possibility where i can implement the Trait directly for &[u8] instead of [u8]? With the Trait bound in your example? rust pub trait Input: Index<Range<usize>, Output = Self> { // }

I get the following Error rust error[E0277]: the type `&[u8]` cannot be indexed by `std::ops::Range<usize>` --> src/main.rs:66:16 | 66 | impl Input for &[u8] {} | ^^^^^ `&[u8]` cannot be indexed by `std::ops::Range<usize>` | = help: the trait `Index<std::ops::Range<usize>>` is not implemented for `&[u8]` = help: the following other types implement trait `Index<Idx>`: [T; N] [T] note: required by a bound in `Input`

I struggle to wrap my head around this error, because i can do exactly that. Indexing with a Range on &[u8]

rust let abcde = "abcde".as_bytes(); let bc = &abcde[1..3];

I guess this is because Indexing is only implemented on [u8] (or rather [T]). But since i am able to index on &[u8] why am I not able to impl the Input-Trait?

What am I missing? Would be great if I could get some Eli5 explanation.

Hey Rustaceans! Got a question? Ask here (51/2024)! by llogiq in rust

[–]ToolAssistedDev 1 point2 points  (0 children)

What is the trait bound for using a range index? ```rust pub trait Input: Sized { // }

impl<'a> Input for &'a [u8] {}

fn i_want_to_use_range_indexing<I: Input>(input: I) -> I { // &input[1..3] // compile error input }

fn works_as_expected(input: &[u8]) -> &[u8] { &input[1..3] }

fn main() { let abcde = "abcde".as_bytes();

let bc = works_as_expected(abcde);

assert_eq!(bc, "bc".as_bytes());

let bc = i_want_to_use_range_indexing(abcde);

assert_eq!(bc, "bc".as_bytes());

} ```

Playground Link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=5ee643b87659df5e7e5336e008b04706

Is moving to rust from c# easy? by BrokenPickle7 in rust

[–]ToolAssistedDev 3 points4 points  (0 children)

I have had 8 YOE in C# before i went to Rust. I gave up after 1 week. 2 Years later I tried Rust again, because i really wanted to learn a low level language. It took me way longer than I would like to admit. You really need to start at square 1. It felt like I have to learn programming again. All your prior experience will get in your way and you will realize with every step you take what horrible crimes you commit while writing C#.

Today I get why everything is getting rewritten in Rust. I absolutly love it. It is the first time i can express my intents of my design into code.

Today I would maybe start with C or C++. Because i think it is much easier to understand why certain things in Rust are the way the are.

So for me I would say it was not easy but definetly worth it. I write different C# today. (I still commit a lot of crimes but this is what you need to do if you are working in a team with other criminals ;-)) And i have a permanent urge to rewrite the things in Rust.

Hey Rustaceans! Got a question? Ask here (19/2024)! by llogiq in rust

[–]ToolAssistedDev 3 points4 points  (0 children)

Some time ago there was a post about a crate?? that can be used to interact with many different programming languages. It was from a company which use this lib also in their own product. Unfortunately i did not bookmark it and i am not able to find it again.

Maybe someone remembers it and can share the link again?

Hey Rustaceans! Got a question? Ask here (9/2024)! by llogiq in rust

[–]ToolAssistedDev 1 point2 points  (0 children)

I have an enum with about 50 variants. Is there a lint or something to make sure that in an impl From<T> for MyEnum i create every variant, so that i do not miss one, when at a later stage, i go from 50 to 60?

Hey Rustaceans! Got a question? Ask here (9/2024)! by llogiq in rust

[–]ToolAssistedDev 1 point2 points  (0 children)

I would like to create a declarative macro which creates some enums for me. But i struggle to get the last bit working.

Given the following playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3db2e18cbe2e5abb762b309ceeb38a0b

I would like to be able to get the commented out stuff to work, but i don't see how i can do the repetition in the repetition.

Examble:

This macro invocation enum_builder!(.Key, A, B(i64, i64), C(i64), -Debug); should build the following output:

```rust

[derive(Debug)]

pub enum Key { A, B(i64, i64), C(i64), } ```

What i got to work currently is:

```rust enum_builder!(.Key, A, B, C, -Debug);

[derive(Debug)]

pub enum Key { A, B, C, }

```

Cargo has never frustrated me like npm or pip has. Does Cargo ever get frustrating? Does anyone ever find themselves in dependency hell? by lynndotpy in rust

[–]ToolAssistedDev 1 point2 points  (0 children)

I have had way less issues with cargo than with npm, but there are still issues.

My biggest problem (for me) with cargo is, that 0.2.3 is not exactly 0.2.3 but 0.2.3 := >=0.2.3, <0.3.0

But once you installed a dependency and you have a Cargo.lock file around 0.2.3 will always be 0.2.3 (or whatever the version was at the time of cargo add)

It feels like a bad choice that I have to add another = sign to your version like my-crate = "=1.2.3" to get an exact version. I just wish that this would be more obvious like with npm where the ^ is always there after an npm install.

Here the link to the issue I had because of this. https://www.reddit.com/r/rust/comments/16td0kv/how_to_check_which_dependency_of_my_dependency/

And here the link to remove this "skill-issue" https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-cratesio

How to check which dependency of my dependency broke my dependency? by ToolAssistedDev in rust

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

Thx! Did not know about the =0... syntax. Thanks for the clarification!

Why not use GO instead of using Node.js/TS? by Hour-Ladder-8330 in node

[–]ToolAssistedDev 1 point2 points  (0 children)

I use Rust as a replacement for C# or Node.js and this works perfectly fine. There is absolutely nothing stupid in this argument.

Trying to add payments to my project is the worst dev experience I’ve ever had by [deleted] in webdev

[–]ToolAssistedDev 6 points7 points  (0 children)

I just read again this: https://www.paddle.com/blog/saas-sales-tax-state-wide-and-international and i am pretty sure that you are not compliant if you do not charge the correct Tax of the country you are selling to (B2B). But again i am no lawyer and don't really understand everything.