▲ 333 ▼ Why make it complicated? (lemmy.ml) submitted 1 year ago* by HiddenLayer555@lemmy.ml to c/programmer_humor@programming.dev 123 comments fedilink hide all child comments Made with KolourPaint and screenshots from Kate (with the GitHub theme).
[–] anton@lemmy.blahaj.zone 4 points 1 year ago (3 children) At least be fair and cut out the .into() permalink fedilink source parent hideshow 3 child comments replies: [–] nebeker@programming.dev 3 points 1 year ago (2 children) And bow to the compiler’s whims? I think not! This shouldn’t compile, because .into needs the type from the left side and let needs the type from the right side. permalink fedilink source parent hideshow 2 child comments replies: [–] Haradion@lemmy.ml 3 points 1 year ago (1 child) If type constraints later in the function let the compiler infer the type, this syntax totally works. permalink fedilink source parent hideshow 1 child comment replies: [–] nebeker@programming.dev 1 point 1 year ago Like if the variable is then used in a function that only takes one type? Huh. permalink fedilink source parent
[–] nebeker@programming.dev 3 points 1 year ago (2 children) And bow to the compiler’s whims? I think not! This shouldn’t compile, because .into needs the type from the left side and let needs the type from the right side. permalink fedilink source parent hideshow 2 child comments replies: [–] Haradion@lemmy.ml 3 points 1 year ago (1 child) If type constraints later in the function let the compiler infer the type, this syntax totally works. permalink fedilink source parent hideshow 1 child comment replies: [–] nebeker@programming.dev 1 point 1 year ago Like if the variable is then used in a function that only takes one type? Huh. permalink fedilink source parent
[–] Haradion@lemmy.ml 3 points 1 year ago (1 child) If type constraints later in the function let the compiler infer the type, this syntax totally works. permalink fedilink source parent hideshow 1 child comment replies: [–] nebeker@programming.dev 1 point 1 year ago Like if the variable is then used in a function that only takes one type? Huh. permalink fedilink source parent
[–] nebeker@programming.dev 1 point 1 year ago Like if the variable is then used in a function that only takes one type? Huh. permalink fedilink source parent