Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
Signed-off-by: xxchan <[email protected]>
  • Loading branch information
xxchan committed Jan 12, 2025
1 parent 866a3ae commit 48f2dfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/iceberg/src/io/object_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

use std::mem::size_of_val;
use std::sync::Arc;

use crate::io::FileIO;
Expand Down
6 changes: 3 additions & 3 deletions crates/iceberg/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

use std::num::NonZero;
use std::num::NonZeroUsize;

// Use a default value of 1 as the safest option.
// See https://doc.rust-lang.org/std/thread/fn.available_parallelism.html#limitations
Expand All @@ -31,12 +31,12 @@ const DEFAULT_PARALLELISM: usize = 1;
/// are circumstances where the level of available
/// parallelism can change during the lifetime of an executing
/// process, but this should not be called in a hot loop.
pub(crate) fn available_parallelism() -> NonZero<usize> {
pub(crate) fn available_parallelism() -> NonZeroUsize {
std::thread::available_parallelism().unwrap_or_else(|_err| {
// Failed to get the level of parallelism.
// TODO: log/trace when this fallback occurs.

// Using a default value.
NonZero::new(DEFAULT_PARALLELISM).unwrap()
NonZeroUsize::new(DEFAULT_PARALLELISM).unwrap()
})
}

0 comments on commit 48f2dfd

Please sign in to comment.