diff --git a/azure-pipelines.yml b/azure-pipelines.yml index de84723..f95f704 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ jobs: endpoint: alecmocatta default: rust_toolchain: nightly - rust_lint_toolchain: nightly-2019-11-14 + rust_lint_toolchain: nightly-2020-01-18 rust_flags: '' rust_features: 'no_alloc;no_alloc distribute_binaries' rust_target_check: '' diff --git a/constellation-internal/src/ext.rs b/constellation-internal/src/ext.rs index d6a7c3b..eff51ba 100644 --- a/constellation-internal/src/ext.rs +++ b/constellation-internal/src/ext.rs @@ -153,7 +153,7 @@ pub fn parse_mem_size(input: &str) -> Result { if index == input.len() { return Ok(a); } - let (b, b1): (u64, u32) = if input[index..=index].chars().nth(0).ok_or(())? == '.' { + let (b, b1): (u64, u32) = if input[index..=index].chars().next().ok_or(())? == '.' { index += 1; let index1 = index; index = index @@ -172,7 +172,7 @@ pub fn parse_mem_size(input: &str) -> Result { } else { (0, 0) }; - if index + 1 < input.len() && input[index..=index].chars().nth(0).ok_or(())? == ' ' { + if index + 1 < input.len() && input[index..=index].chars().next().ok_or(())? == ' ' { index += 1; } let c: u64 = match &input[index..] { @@ -203,7 +203,7 @@ pub fn parse_cpu_size(input: &str) -> Result { if index == input.len() { return Ok(a * 65536); } - let (b, b1): (u64, u32) = if input[index..=index].chars().nth(0).ok_or(())? == '.' { + let (b, b1): (u64, u32) = if input[index..=index].chars().next().ok_or(())? == '.' { index += 1; let index1 = index; index = index diff --git a/constellation-internal/src/lib.rs b/constellation-internal/src/lib.rs index 0bfae4a..6cec597 100644 --- a/constellation-internal/src/lib.rs +++ b/constellation-internal/src/lib.rs @@ -20,7 +20,8 @@ clippy::if_not_else, clippy::inline_always, clippy::must_use_candidate, - clippy::double_must_use + clippy::double_must_use, + clippy::missing_errors_doc )] mod ext; @@ -280,8 +281,8 @@ pub enum Format { /// ``` /// # use constellation_internal::Resources; /// pub const RESOURCES_DEFAULT: Resources = Resources { -/// mem: 100 * 1024 * 1024, // 100 MiB -/// cpu: 65536 / 16, // 1/16th of a logical CPU core +/// mem: 100 * 1024 * 1024, // 100 MiB +/// cpu: 65536 / 16, // 1/16th of a logical CPU core /// }; /// ``` #[derive(Copy, Clone, PartialEq, Serialize, Deserialize, Debug)] @@ -301,8 +302,8 @@ impl Default for Resources { /// ``` /// # use constellation_internal::Resources; /// pub const RESOURCES_DEFAULT: Resources = Resources { -/// mem: 100 * 1024 * 1024, // 100 MiB -/// cpu: 65536 / 16, // 1/16th of a logical CPU core +/// mem: 100 * 1024 * 1024, // 100 MiB +/// cpu: 65536 / 16, // 1/16th of a logical CPU core /// }; /// ``` pub const RESOURCES_DEFAULT: Resources = Resources { diff --git a/src/bin/cargo-deploy.rs b/src/bin/cargo-deploy.rs index 322d08e..6e226af 100644 --- a/src/bin/cargo-deploy.rs +++ b/src/bin/cargo-deploy.rs @@ -53,7 +53,7 @@ fn main() { if artifact.target.kind == vec![String::from("bin")] { assert_eq!(artifact.filenames.len(), 1); assert!(bin.is_none()); - bin = Some(artifact.filenames.into_iter().nth(0).unwrap()); + bin = Some(artifact.filenames.into_iter().next().unwrap()); } } } diff --git a/tests/tester/ext.rs b/tests/tester/ext.rs index 70f92de..cafd7bd 100644 --- a/tests/tester/ext.rs +++ b/tests/tester/ext.rs @@ -69,8 +69,8 @@ pub mod serde_regex { S: Serializer, { let x = value.as_str(); - assert_eq!(x.chars().nth(0).unwrap(), '^'); - assert_eq!(x.chars().rev().nth(0).unwrap(), '$'); + assert_eq!(x.chars().next().unwrap(), '^'); + assert_eq!(x.chars().rev().next().unwrap(), '$'); serializer.serialize_str(&x[1..x.len() - 1]) } pub fn deserialize<'de, D>(deserializer: D) -> Result diff --git a/tests/tester/main.rs b/tests/tester/main.rs index 1553a3f..91dbbbf 100644 --- a/tests/tester/main.rs +++ b/tests/tester/main.rs @@ -314,7 +314,7 @@ fn main() { // assert_eq!(artifact.filenames.len(), 1, "{:?}", artifact); let x = products.insert( path.to_owned(), - artifact.filenames.into_iter().nth(0).unwrap(), + artifact.filenames.into_iter().next().unwrap(), ); assert!(x.is_none()); }