Fixing cargo doc and typo in CHANGELOG.

This commit is contained in:
Joshua Yanovski 2020-08-20 18:46:25 +02:00
parent ec0aeb18e8
commit 300505e730
2 changed files with 20 additions and 12 deletions

View File

@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- MSAAA has been removed due to incompatibility with greeddy meshing.
- MSAA has been removed due to incompatibility with greedy meshing.
- Removed a saturation hack that led to colors being improperly displayed.
## [0.7.0] - 2020-08-15

View File

@ -41,13 +41,16 @@ impl<Context: SubContext<S>, T, S> Typed<Context, Pure<T>, S> for T {
/// [make_case_elim!], as follows:
///
/// ```
/// make_case_elim!(
/// # #![feature(arbitrary_enum_discriminant)]
/// # #[macro_use] extern crate veloren_common;
///
/// veloren_common::make_case_elim!(
/// my_type_module,
/// #[repr(u32)]
/// #[derive(Clone,Copy,OtherAttribs)]
/// #[derive(Clone,Copy)]
/// pub enum MyType {
/// Constr1 = 0,
/// Constr2(arg : ArgType) = 1,
/// Constr2(arg : u8) = 1,
/// /* ..., */
/// }
/// );
@ -59,15 +62,20 @@ impl<Context: SubContext<S>, T, S> Typed<Context, Pure<T>, S> for T {
/// few things. In this case:
///
/// ```
/// # #![feature(arbitrary_enum_discriminant)]
/// # #[macro_use] extern crate veloren_common;
///
/// #[repr(u32)]
/// #[derive(Clone,Copy,OtherAttribs)]
/// #[derive(Clone, Copy)]
/// pub enum MyType {
/// Constr1 = 0,
/// Constr2(arg : ArgType) = 1,
/// Constr2(u8) = 1,
/// /* ..., */
/// }
///
/// mod make_case_elim {
/// # #[allow(non_snake_case)]
/// # #[allow(dead_code)]
/// mod my_type_module {
/// use ::serde::{Deserialize, Serialize};
///
/// /// The number of variants in this enum.
@ -92,14 +100,14 @@ impl<Context: SubContext<S>, T, S> Typed<Context, Pure<T>, S> for T {
/// /// the [Elim] argument. Each field has the same name as the constructor it represents.
/// #[derive(Serialize, Deserialize)]
/// pub struct Cases<Elim: PackedElim> {
/// pub constr: Elim::Constr1,
/// pub constr: Elim::Constr2,
/// pub Constr1: Elim::Constr1,
/// pub Constr2: Elim::Constr2,
/// }
///
/// /// Finally, because it represents by an overwhelming margin the most common usecase, we
/// /// predefine a particular pattern matching strategy--"pure"--where every arm holds data of
/// /// the exact same type, T.
/// impl<T> PackedElim for typed::Pure<T> {
/// impl<T> PackedElim for veloren_common::typed::Pure<T> {
/// type Constr1 = T;
/// type Constr2 = T;
/// }
@ -107,7 +115,7 @@ impl<Context: SubContext<S>, T, S> Typed<Context, Pure<T>, S> for T {
/// /// Because PureCases is so convenient, we have an alias for it. Thus, in order to
/// /// represent a pattern match on an argument that returns a constant of type (u8,u8,u8) for
/// /// each arm, you'd use the type `PureCases<(u8, u8, u8)>`.
/// pub type PureCases<Elim> = Cases<$crate::typed::Pure<Elim>>;
/// pub type PureCases<Elim> = Cases<veloren_common::typed::Pure<Elim>>;
/// }
/// ```
///