Skip to content

Commit 95c9ec5

Browse files
committed
lint for warning missing documentation
This change also includes the fixes for currently missing documentation and crate level documentation.
1 parent abf8bf8 commit 95c9ec5

File tree

6 files changed

+48
-1
lines changed

6 files changed

+48
-1
lines changed

src/defines.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,24 +339,37 @@ pub enum HomographyType {
339339
#[repr(C)]
340340
#[derive(Clone, Copy, Debug, PartialEq)]
341341
pub enum MarkerType {
342+
/// No marker
342343
NONE = 0,
344+
/// Pointer marker
343345
POINT = 1,
346+
/// Hollow circle marker
344347
CIRCLE = 2,
348+
/// Hollow Square marker
345349
SQUARE = 3,
350+
/// Hollow Triangle marker
346351
TRIANGLE = 4,
352+
/// Cross-hair marker
347353
CROSS = 5,
354+
/// Plus symbol marker
348355
PLUS = 6,
356+
/// Start symbol marker
349357
STAR = 7
350358
}
351359

352360
/// Image moment types
353361
#[repr(C)]
354362
#[derive(Clone, Copy, Debug, PartialEq)]
355363
pub enum MomentType {
364+
/// Central moment of order (0 + 0)
356365
M00 = 1, // 1<<0
366+
/// Central moment of order (0 + 1)
357367
M01 = 2, // 1<<1
368+
/// Central moment of order (1 + 0)
358369
M10 = 4, // 1<<2
370+
/// Central moment of order (1 + 1)
359371
M11 = 8, // 1<<3
372+
/// All central moments of order (0,0), (0,1), (1,0) and (1,1)
360373
FIRST_ORDER = 1<<0 | 1<<1 | 1<<2 | 1<<3
361374
}
362375

@@ -378,9 +391,13 @@ pub enum SparseFormat {
378391
#[repr(C)]
379392
#[derive(Clone, Copy, Debug, PartialEq)]
380393
pub enum BinaryOp {
394+
/// Addition operation
381395
ADD = 0,
396+
/// Multiplication operation
382397
MUL = 1,
398+
/// Minimum operation
383399
MIN = 2,
400+
/// Maximum operation
384401
MAX = 3
385402
}
386403

@@ -396,9 +413,13 @@ pub enum RandomEngineType {
396413
MERSENNE_GP11213 = 300
397414
}
398415

416+
/// Default Philon RandomEngine that points to [PHILOX_4X32_10](./enum.RandomEngineType.html)
399417
pub const PHILOX : RandomEngineType = RandomEngineType::PHILOX_4X32_10;
418+
/// Default Threefry RandomEngine that points to [THREEFRY_2X32_16](./enum.RandomEngineType.html)
400419
pub const THREEFRY : RandomEngineType = RandomEngineType::THREEFRY_2X32_16;
420+
/// Default Mersenne RandomEngine that points to [MERSENNE_GP11213](./enum.RandomEngineType.html)
401421
pub const MERSENNE : RandomEngineType = RandomEngineType::MERSENNE_GP11213;
422+
/// Default RandomEngine that defaults to [PHILOX](./constant.PHILOX.html)
402423
pub const DEFAULT_RANDOM_ENGINE : RandomEngineType = PHILOX;
403424

404425
/// Scalar value types

src/dim4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Dim4 {
8484
}
8585
}
8686

87-
// Get the dimensions as a slice of 4 values
87+
/// Get the dimensions as a slice of 4 values
8888
pub fn get(&self) -> &[u64; 4] {
8989
&self.dims
9090
}

src/error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ use std::error::Error;
44
use std::marker::{Send, Sync};
55
use std::sync::RwLock;
66

7+
/// Signature of callback function to be called to handle errors
78
pub type ErrorCallback = Fn(AfError);
89

910
/// Wrap ErrorCallback function pointer inside a structure
1011
/// to enable implementing Send, Sync traits on it.
1112
pub struct Callback<'cblifetime> {
13+
///Reference to a valid error callback function
14+
///Make sure this callback stays relevant throughout the lifetime of application.
1215
pub cb: &'cblifetime ErrorCallback,
1316
}
1417

@@ -60,6 +63,7 @@ pub fn register_error_handler(cb_value: Callback<'static>) {
6063
*gaurd.deref_mut() = cb_value;
6164
}
6265

66+
/// Default error handling callback provided by ArrayFire crate
6367
pub fn handle_error_general(error_code: AfError) {
6468
match error_code {
6569
AfError::SUCCESS => {}, /* No-op */

src/index.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ impl<T: Copy> Indexable for Seq<T> where c_double: From<T> {
6868

6969
impl Indexer {
7070
#[allow(unused_mut)]
71+
/// Create a new Indexer object and set the dimension specific index objects later
7172
pub fn new() -> Indexer {
7273
unsafe {
7374
let mut temp: i64 = 0;

src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
1+
//! ArrayFire is a high performance software library for parallel computing with
2+
//! an easy-to-use API. ArrayFire abstracts away much of the details of
3+
//! programming parallel architectures by providing a high-level container object,
4+
//! the [Array](./struct.Array.html), that represents data stored on a CPU, GPU, FPGA,
5+
//! or other type of accelerator. This abstraction permits developers to write
6+
//! massively parallel applications in a high-level language where they need
7+
//! not be concerned about low-level optimizations that are frequently required to
8+
//! achieve high throughput on most parallel architectures.
9+
10+
//! This crate provides Rust bindings for the ArrayFire library. Given below table shows the rust bindings compatability with ArrayFire upstream. If you find any bugs, please report them on [github](https://github.com/arrayfire/arrayfire-rust/issues).
11+
//!
12+
//!
13+
//! | ArrayFire Upstream | Rust Crate |
14+
//! |:------------------:|:---------------:|
15+
//! | 3.3.x | 3.3.x |
16+
//! | 3.4.x | 3.4.x |
17+
//!
18+
//! Only, Major & Minor version numbers need to match.
19+
120
#![doc(html_logo_url = "http://www.arrayfire.com/logos/arrayfire_logo_symbol.png",
221
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
322
html_root_url = "http://arrayfire.com/docs/rust")]
23+
#![warn(missing_docs)]
424

525
#[macro_use]
626
extern crate lazy_static;

src/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl From<i32> for ColorMap {
153153
/// - u16
154154
///
155155
pub trait HasAfEnum {
156+
/// Return trait implmentors corresponding [DType](./enum.DType.html)
156157
fn get_af_dtype() -> DType;
157158
}
158159

0 commit comments

Comments
 (0)