B
this post is made by nightly gang
Size: a a a
B
LM
enum Numbers {
Nums(i32, i32, i32),
}
fn main() {
let Numbers::Nums(x1, x2, x3) = Numbers::Nums(1, 2, 20);
let x = 20;
match x {
x if (x == x1 || x == x2 || x == x3) => {
println!("aha, got'em")
}
_ => {}
}
}gо
ifA
AT
A
LM
LM
LM
L
x константа, или просто пример кривой?match nums{
Numbers::Nums(20,20,20) => true,
- => false,
}NE
L
L
pub fn foo(nums:(u8,u8,u8),y:u8)->bool{
match nums{
(x,_,_) if x == y => true,
(_,x,_) if x == y => true,
(_,_,x) if x == y => true,
_ => false,
}
}LM
use rand::Rng;
fn remux_audio(muxer: &Muxer, stream_index: i32) {}
fn remux_video(muxer: &Muxer, stream_index: i32) {}
fn remux_subtitles(muxer: &Muxer, stream_index: i32) {}
enum StreamIndexes {
AudioStream(i32, i32),
VideoStream(i32, i32),
}
fn main() {
let StreamIndexes::AudioStream(audio_stream_0, audio_stream_1) =
StreamIndexes::AudioStream(0, 1);
let StreamIndexes::VideoStream(video_stream_0, video_stream_1) =
StreamIndexes::VideoStream(2, 3);
let mut rng = rand::thread_rng();
let stream_index: i32 = rng.gen; // unknown in compile-time
match stream_index {
idx if (idx == audio_stream_0 || idx == audio_stream_1) => remux_audio(&muxer, idx),
idx if (idx == video_stream_0 || idx == video_stream_1) => remux_video(&muxer, idx),
_ => {}
}
}
GS
LM
L
idx == video_stream_1 || idx == video_stream_1LM
А⚙
D
enum Numbers {
Nums(i32, i32, i32),
}
fn main() {
let Numbers::Nums(x1, x2, x3) = Numbers::Nums(1, 2, 20);
let x = 20;
if x == x1 || x == x2 || x == x3 => {
println!("aha, got'em")
}
}
как тебе такое илон маск?)