We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 319055b commit 17fcf95Copy full SHA for 17fcf95
src/cmds/pick.rs
@@ -139,8 +139,8 @@ impl Command for PickCommand {
139
//check for name specified
140
true => {
141
match m.get_one::<String>("name").map(|name| name) {
142
- Some(quesname) => match cache.get_problem_from_name(quesname) {
143
- Ok(p) => p.fid,
+ Some(quesname) => match cache.get_problem_id_from_name(quesname) {
+ Ok(p) => p,
144
Err(_) => 1,
145
},
146
None => {
@@ -158,18 +158,11 @@ impl Command for PickCommand {
158
// Pick random without specify id
159
let problem = &problems[rand::thread_rng().gen_range(0..problems.len())];
160
problem.fid
161
- });
162
-
163
- let id = match fid {
164
- Ok(id) => id,
165
- Err(_) => {
166
- // Pick random without specify id
167
- let problem = &problems[rand::thread_rng().gen_range(0..problems.len())];
168
- problem.fid
+ })
169
}
170
};
171
172
- let r = cache.get_question(id).await;
+ let r = cache.get_question(fid).await;
173
174
match r {
175
Ok(q) => println!("{}", q.desc()),
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments