Skip to content

Commit

Permalink
Update for Rust 1.77 (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdygert-spok authored and GitHub Enterprise committed Mar 26, 2024
1 parent ca1fb9d commit 5f64556
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors = ["SpiderOak, Inc."]
edition = "2021"
license = "UNLICENSED"
publish = false
rust-version = "1.76"
rust-version = "1.77"

[workspace.lints.rust]
# missing_docs = "warn"
Expand Down
24 changes: 0 additions & 24 deletions crates/aps-util/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,27 +285,3 @@ impl TryFrom<Value> for Label {
))
}
}

/// For `optional int` in policy.
pub(crate) struct OptionalLabel(Option<Label>);

impl OptionalLabel {
const fn none() -> Self {
Self(None)
}

const fn some(label: Label) -> Self {
Self(Some(label))
}
}

impl TryFrom<Value> for OptionalLabel {
type Error = MachineErrorType;

fn try_from(value: Value) -> Result<Self, Self::Error> {
match value {
Value::None => Ok(OptionalLabel::none()),
v => Ok(OptionalLabel::some(v.try_into()?)),
}
}
}
2 changes: 1 addition & 1 deletion crates/crypto/examples/hsm/hsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize};

/// An error returned by [`Hsm`].
#[derive(Debug)]
pub(crate) enum HsmError {
pub enum HsmError {
/// Unable to authenticate the wrapped key.
Authentication,
/// The key was not found.
Expand Down
8 changes: 3 additions & 5 deletions crates/rtrack/src/spira/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn init() {
}

thread_local! {
static RECORDER: RefCell<Option<Recorder>> = RefCell::new(None);
static RECORDER: RefCell<Option<Recorder>> = const { RefCell::new(None) };
}

/// Records the result of the test.
Expand Down Expand Up @@ -253,9 +253,7 @@ enum Needle<'a> {
#[derive(Debug)]
enum Match<'a> {
/// Did not find a match.
///
/// It returns the haystack.
None(&'a str),
None,
/// Found a prefix match ([`Needle::Prefix`]).
Prefix { prefix: &'a str, suffix: &'a str },
/// Found a complete match ([`Needle::Complete`]).
Expand All @@ -280,7 +278,7 @@ where
_ => continue,
}
}
Match::None(haystack)
Match::None
}

struct Recorder {
Expand Down
1 change: 1 addition & 0 deletions crates/runtime/tests/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ impl Display for TestRule {
}

#[derive(Debug)]
#[allow(dead_code)] // fields used only via `Debug`
enum TestError {
Storage(StorageError),
Client(ClientError),
Expand Down

0 comments on commit 5f64556

Please sign in to comment.