Skip to content

Commit

Permalink
symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Jan 29, 2025
1 parent fff0185 commit 732f9a2
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion platform/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::PathBuf;
fn main() {
let project_root = {
let manifest = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let root = manifest.join("maplibre-native-src");
let root = manifest.join("core-src");
if root.is_symlink() || root.is_dir() {
// Use the symlinked directory to allow packaging
root
Expand Down
1 change: 1 addition & 0 deletions platform/rust/core-src/ARCHITECTURE.md
1 change: 1 addition & 0 deletions platform/rust/core-src/CHANGELOG.md
1 change: 1 addition & 0 deletions platform/rust/core-src/CMakeLists.txt
1 change: 1 addition & 0 deletions platform/rust/core-src/CODE-OF-CONDUCT.md
1 change: 1 addition & 0 deletions platform/rust/core-src/CONTRIBUTING.md
1 change: 1 addition & 0 deletions platform/rust/core-src/LICENSE.md
1 change: 1 addition & 0 deletions platform/rust/core-src/LICENSES.core.md
1 change: 1 addition & 0 deletions platform/rust/core-src/README.md
1 change: 1 addition & 0 deletions platform/rust/core-src/SECURITY.md
1 change: 1 addition & 0 deletions platform/rust/core-src/include
1 change: 1 addition & 0 deletions platform/rust/core-src/rustutils
1 change: 1 addition & 0 deletions platform/rust/core-src/scripts
1 change: 1 addition & 0 deletions platform/rust/core-src/shaders
1 change: 1 addition & 0 deletions platform/rust/core-src/src
1 change: 1 addition & 0 deletions platform/rust/core-src/vendor
1 change: 0 additions & 1 deletion platform/rust/maplibre-native-src

This file was deleted.

8 changes: 4 additions & 4 deletions platform/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod ffi {
}

/// A safe Rust wrapper so you can call `ceil_log2` from your code:
pub fn our_log(x: u64) -> u32 {
pub fn ceil_log2(x: u64) -> u32 {
ffi::ceil_log2(x)
}

Expand All @@ -26,13 +26,13 @@ mod tests {
use super::*;
#[test]
fn test_log2() {
let result = our_log(1);
let result = ceil_log2(1);
assert_eq!(result, 0, "log2(1) = 0 bits needed");

let result = our_log(2);
let result = ceil_log2(2);
assert_eq!(result, 1, "log2(2) = 1 bit needed");

let result = our_log(3);
let result = ceil_log2(3);
assert_eq!(result, 2, "log2(3) -> 2 bits needed");
}
}

0 comments on commit 732f9a2

Please sign in to comment.