Skip to content

Commit

Permalink
Fixed doc warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim committed Nov 8, 2022
1 parent da88a15 commit a701167
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/raster/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::fmt::{Debug, Display, Formatter};
///
/// # Example
/// ```rust, no_run
/// use gdal::raster::{GdalType, GdalDataType};
/// use gdal::raster::GdalType;
/// let td = <u32>::datatype();
/// println!("{} is {} and uses {} bits.",
/// td.name(),
Expand Down Expand Up @@ -253,7 +253,7 @@ impl Display for GdalDataType {
/// # Example
///
/// ```rust, no_run
/// use gdal::raster::{GdalType, GdalDataType};
/// use gdal::raster::GdalDataType;
/// let gdt: GdalDataType = 3.try_into().unwrap();
/// println!("{gdt:#?}")
/// ```
Expand All @@ -276,9 +276,12 @@ impl TryFrom<u32> for GdalDataType {
GDT_Int64 => Ok(GdalDataType::Int64),
GDT_Float32 => Ok(GdalDataType::Float32),
GDT_Float64 => Ok(GdalDataType::Float64),
GDT_CInt16 | GDT_CInt32 | GDT_CFloat32 | GDT_CFloat64 =>
Err(GdalError::BadArgument("Complex data types are not available".into())),
o => Err(GdalError::BadArgument(format!("unknown GDALDataType ordinal' {o}'")))
GDT_CInt16 | GDT_CInt32 | GDT_CFloat32 | GDT_CFloat64 => Err(GdalError::BadArgument(
"Complex data types are not available".into(),
)),
o => Err(GdalError::BadArgument(format!(
"unknown GDALDataType ordinal' {o}'"
))),
}
}
}
Expand Down Expand Up @@ -450,7 +453,6 @@ mod tests {
for t in [GDT_CInt16, GDT_CInt32, GDT_CFloat32, GDT_CFloat64] {
assert!(TryInto::<GdalDataType>::try_into(t).is_err());
}

}

#[test]
Expand Down

0 comments on commit a701167

Please sign in to comment.