From 040f94472bbdd2212131661a85f4083fd6bc10be Mon Sep 17 00:00:00 2001 From: fwqaaq Date: Wed, 8 Nov 2023 21:09:36 +0800 Subject: [PATCH] Apply suggestions from code review --- problems/0704.二分查找.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/problems/0704.二分查找.md b/problems/0704.二分查找.md index 46f529db..590ec1b1 100644 --- a/problems/0704.二分查找.md +++ b/problems/0704.二分查找.md @@ -484,6 +484,7 @@ func search(nums: [Int], target: Int) -> Int { (版本一)左闭右开区间 ```rust +use std::cmp::Ordering; impl Solution { pub fn search(nums: Vec, target: i32) -> i32 { let (mut left, mut right) = (0, nums.len()); @@ -503,6 +504,7 @@ impl Solution { //(版本二)左闭右闭区间 ```rust +use std::cmp::Ordering; impl Solution { pub fn search(nums: Vec, target: i32) -> i32 { let (mut left, mut right) = (0, nums.len());