Skip to content

Commit

Permalink
bump rust lint toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmocatta committed Jan 19, 2020
1 parent e23102d commit 83b729c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Expand Up @@ -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: ''
Expand Down
6 changes: 3 additions & 3 deletions constellation-internal/src/ext.rs
Expand Up @@ -153,7 +153,7 @@ pub fn parse_mem_size(input: &str) -> Result<u64, ()> {
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
Expand All @@ -172,7 +172,7 @@ pub fn parse_mem_size(input: &str) -> Result<u64, ()> {
} 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..] {
Expand Down Expand Up @@ -203,7 +203,7 @@ pub fn parse_cpu_size(input: &str) -> Result<u32, ()> {
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
Expand Down
11 changes: 6 additions & 5 deletions constellation-internal/src/lib.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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)]
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo-deploy.rs
Expand Up @@ -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());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/tester/ext.rs
Expand Up @@ -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<Regex, D::Error>
Expand Down
2 changes: 1 addition & 1 deletion tests/tester/main.rs
Expand Up @@ -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());
}
Expand Down

0 comments on commit 83b729c

Please sign in to comment.