✨ Using variable inside Format String
👉 It appears many people are not aware of this syntax that was introduced in Rust 1.58(2022/01/13)
👉 You can also use format specifiers along with it
#rustlang #rusttips #rust #learnrust #programming
👉 It appears many people are not aware of this syntax that was introduced in Rust 1.58(2022/01/13)
👉 You can also use format specifiers along with it
#rustlang #rusttips #rust #learnrust #programming
🦀 #RustChallenge
What is the result?
A. Error
B. Prints 2 4 6 8
C. Prints 2
D. Prints 2 6 8
#rustlang #rust
Vote here in channele
fn main() {
let mut i = 0;
'hello_world : loop {
i = i +2;
println!("{}",i);
if i < 4{
break 'hello_world;
}
if i < 10{
break ;
}
}
}What is the result?
A. Error
B. Prints 2 4 6 8
C. Prints 2
D. Prints 2 6 8
#rustlang #rust
Vote here in channele
🦀 #RustChallenge
#rust #rustlang #programing #dev
B - true true true true
C - false treu true true
D - true false true true
vote in channele 👇
#rust #rustlang #programing #dev
fn main(){
let a = "Hello";
let b = &*&&*a;
let c = &*&*a;
let d = &**&&*a;
println!("{}", format!("{:p}", c) == format!("{:p}", a));
println!("{}", format!("{:p}", c) == format!("{:p}", b));
println!("{}", format!("{:p}", c) == format!("{:p}", c));
println!("{}", format!("{:p}", c) == format!("{:p}", d));
}
A - err (explain)B - true true true true
C - false treu true true
D - true false true true
vote in channele 👇
👍3
🦀 #RustChallenge 🦀
#rust #rustlang #programing #dev #EZ
1. Both runs and gives the output
2. CODE No2 gives output and A gives overflow error
3. CODE No2 gives output and B gives error
4. Both gives error
vote in channele and DONT FORGET TO JOIN OUR FAMELY
#rust #rustlang #programing #dev #EZ
// CODE No1What will be the outcome?
fn main(){
let x = 2;
assert_eq!(x,2_i8);
println!("{}",x.pow(6));
}
// CODE No2
fn main(){
let x = 2;
println!("{}",x.pow(6));
}
1. Both runs and gives the output
2. CODE No2 gives output and A gives overflow error
3. CODE No2 gives output and B gives error
4. Both gives error
vote in channele and DONT FORGET TO JOIN OUR FAMELY
Learning Rust Part 1: A kitten's guide to Options and Results
https://cherrykitten.dev/blog/rust-1-options-results/
https://cherrykitten.dev/blog/rust-1-options-results/
#RustChallenge 🦀🦀
What is the result?
A. Prints 1 (explain how)
B. Prints 2 (explain how)
C. Error (explain why)
✨vote in channele and don't forget to join our rust family❤️
What is the result?
A. Prints 1 (explain how)
B. Prints 2 (explain how)
C. Error (explain why)
✨vote in channele and don't forget to join our rust family❤️
The New Website and Release for the KCL Programming Language Written by Rust:
https://kcl-lang.io/blog/2022-kcl-0.4.5-release-blog/
https://kcl-lang.io/blog/2022-kcl-0.4.5-release-blog/
kcl-lang.io
KCL v0.4.5 Release Blog | KCL programming language.
Introduction