Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkgs/id/src/commands/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ fn download_output_path(dir: Option<&str>, name: &str) -> Result<String> {
/// # Errors
///
/// Returns an error if no matches are found for any query.
///

/// # Example
///
/// ```bash
Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/src/commands/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ use crate::commands::tag::{self as tag, TagDisplayOptions};
use crate::local::LocalNode;
use crate::meta_client::{MetaRequester, expect_ok, read_capped_response, request_over};
use crate::{
CLIENT_KEY_FILE, FindMatch, META_ALPN, MatchKind, MetaRequest, MetaResponse, StoreType,
CLIENT_KEY_FILE, FindMatch, META_ALPN, MetaRequest, MetaResponse, StoreType,
export_blob, is_node_id, load_or_create_keypair, open_store,
};

Expand Down
15 changes: 0 additions & 15 deletions pkgs/id/src/event_store/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ impl EventStore {
self.waiting.waiting_count(*author)
}

/// Whether the event with this ID is held, waiting or parked.
pub fn is_waiting(&self, id: &Hash) -> bool {
self.waiting.contains(id)
}
Expand Down Expand Up @@ -464,19 +463,6 @@ enum Staged {
}

impl Staged {
/// Whether the event is kept: stored, or held. A refused event and a fork are not.
fn keeps(&self) -> bool {
matches!(
self,
Self::Stored { .. }
| Self::Ready(
Ingest::Accepted { .. }
| Ingest::Voided { .. }
| Ingest::Duplicate { .. }
| Ingest::Waiting { .. },
)
)
}

/// The outcome, with its labels read from the store as it is now.
fn finish(self, txn: &WriteTransaction) -> Result<Ingest, StoreError> {
Expand Down Expand Up @@ -1035,7 +1021,6 @@ fn missing_deps(txn: &WriteTransaction, after: &[Hash]) -> Result<Vec<Hash>, Sto
Ok(missing)
}

/// Whether the event with this ID applies, in the resolved state.
pub(super) fn is_applied(txn: &WriteTransaction, hash: &Hash) -> Result<bool, StoreError> {
let applied = txn.open_table(APPLIED)?;
let found = applied.get(hash.as_bytes().as_slice())?.is_some();
Expand Down
6 changes: 3 additions & 3 deletions pkgs/id/src/meta_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ pub fn expect_ok(resp: MetaResponse) -> Result<MetaResponse> {
/// limit instead. Any other read failure passes through unchanged.
pub fn capped_response_error(err: ReadToEndError) -> anyhow::Error {
match err {
ReadToEndError::TooLong => anyhow::anyhow!(
"response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit"
),
ReadToEndError::TooLong => {
anyhow::anyhow!("response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit")
}
other => other.into(),
}
}
Expand Down
90 changes: 45 additions & 45 deletions pkgs/id/src/tags.rs

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions pkgs/id/src/web/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,12 +821,6 @@ fn convert_list_runs<'a>(node: &'a AstNode<'a>) -> Vec<Value> {
}

/// Collect list item children of a list node.
fn collect_list_items<'a>(node: &'a AstNode<'a>) -> Vec<Value> {
node.children()
.map(|child| convert_node(child, &[]))
.filter(|v| !v.is_null())
.collect()
}

/// The literal of an `HtmlInline` node, if `node` is one.
fn html_inline_literal<'a>(node: &'a AstNode<'a>) -> Option<String> {
Expand Down Expand Up @@ -2397,8 +2391,6 @@ fn insert_marked_chain<'a>(
/// wrapper when a marked chain that shares that wrapper's mark is
/// about to be inserted. The parse direction emits `html_inline`
/// atoms markless (see the `NodeValue::HtmlInline` arm of
/// `convert_node`), so a mark spanning an atom reaches the save
/// direction as marked run, bare atom, marked run. Appending the
/// atom as a sibling severs the tail wrapper: the next run opens a
/// NEW wrapper and the span fragments (`[a <b>x</b> c](/y)` saved as
/// `[a ](/y)<b>[x](/y)</b>[ c](/y)`, with `&#32;` leaks at emphasis
Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/src/world/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl WorldActor {
Decision::Deny(error) => {
let spec = sub.spec();
if self.denied_subs.insert(spec.clone()) {
self.deliver(crate::world_caps::subscription_refused_event(&spec, error))
self.deliver(crate::world_caps::subscription_refused_event(&spec, &error))
.await;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/src/world_caps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ pub fn result_event(id: &str, outcome: Result<serde_json::Value, CapError>) -> S

/// The event delivered when a subscription is refused.
#[must_use]
pub fn subscription_refused_event(spec: &str, error: CapError) -> String {
pub fn subscription_refused_event(spec: &str, error: &CapError) -> String {
let mut event =
serde_json::json!({"cap":"subscription","spec":spec,"ok":false,"error":error.code()});
if let Some(reason) = error.reason() {
Expand Down
26 changes: 13 additions & 13 deletions pkgs/id/src/world_doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub fn check_toolchain(inputs: &DoctorInputs) -> Finding {
};
// A configured binary must exist. A bare name resolves through PATH.
let exists = if roc_bin.contains('/') {
std::path::Path::new(roc_bin).is_file()
Path::new(roc_bin).is_file()
} else {
std::env::split_paths(&std::env::var_os("PATH").unwrap_or_default())
.map(|dir| dir.join(roc_bin))
Expand Down Expand Up @@ -371,8 +371,8 @@ pub fn validate_journal_file(path: &Path) -> Result<(usize, u32)> {
.map_err(|error| anyhow::anyhow!("entry {} is malformed: {error}", index + 1))?;
match &entry {
crate::world::JournalEntry::Created {
world_id: _,
version: created_version,

world_id: _, version: created_version,
} => {
anyhow::ensure!(
entries == 0,
Expand Down Expand Up @@ -463,7 +463,7 @@ mod tests {
// A missing resolution is a failure, independent of the host's PATH.
let finding = check_toolchain(&DoctorInputs {
roc_resolved: Some(Err("no roc binary".to_owned())),
..inputs()
.. inputs()
});
assert_eq!(finding.severity, Severity::Fail);
assert!(!finding.fix.is_empty());
Expand All @@ -480,19 +480,19 @@ mod tests {
fn a_ceiling_refuses_wildcards_and_unknown_names() {
let finding = check_ceiling(&DoctorInputs {
caps_ceiling: Some(vec!["*".to_owned()]),
..inputs()
.. inputs()
});
assert_eq!(finding.severity, Severity::Fail);

let finding = check_ceiling(&DoctorInputs {
caps_ceiling: Some(vec!["time.nwo".to_owned()]),
..inputs()
.. inputs()
});
assert_eq!(finding.severity, Severity::Fail);

let finding = check_ceiling(&DoctorInputs {
caps_ceiling: Some(vec!["time.now".to_owned(), "chat.say".to_owned()]),
..inputs()
.. inputs()
});
assert_eq!(finding.severity, Severity::Ok);
}
Expand All @@ -502,9 +502,9 @@ mod tests {
let finding = check_profile(&DoctorInputs {
profile: Some(WorldExecutionProfile {
wasm_fuel: Some(0),
..WorldExecutionProfile::default()
.. WorldExecutionProfile::default()
}),
..inputs()
.. inputs()
});
assert_eq!(finding.severity, Severity::Fail);
assert!(finding.detail.contains("wasm_fuel"), "{}", finding.detail);
Expand Down Expand Up @@ -609,7 +609,7 @@ mod tests {
// findings out of 6 checks.
let report = run(&DoctorInputs {
roc_resolved: Some(Err("no roc binary".to_owned())),
..inputs()
.. inputs()
});
assert_eq!(report.findings.len(), 6, "{report:#?}");
assert_eq!(report.failure_count(), 2, "{report:#?}");
Expand All @@ -626,10 +626,10 @@ mod tests {
caps_ceiling: Some(vec!["*".to_owned()]),
profile: Some(WorldExecutionProfile {
wasm_fuel: Some(0),
..WorldExecutionProfile::default()
.. WorldExecutionProfile::default()
}),
roc_resolved: Some(Err("no roc binary".to_owned())),
..inputs()
.. inputs()
});
let ceiling = &report.findings[2];
assert_eq!(ceiling.check, "ceiling");
Expand All @@ -644,7 +644,7 @@ mod tests {
fn a_clock_before_the_epoch_fails() {
let finding = check_clock(&DoctorInputs {
now_ms: Some(0),
..inputs()
.. inputs()
});
assert_eq!(finding.severity, Severity::Fail);

Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/src/world_session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mod tests;
mod types;

pub(crate) use types::{
CAPS_CEILING_NOTICE, ClientFrame, CompileFile, MAX_ADMIN_TOKEN_BYTES, MAX_CAPABILITY_BYTES,
CAPS_CEILING_NOTICE, ClientFrame, MAX_ADMIN_TOKEN_BYTES, MAX_CAPABILITY_BYTES,
MAX_CONCURRENT_MODULE_UPLOADS, ServerFrame, invite_bounds,
};
pub use types::{
Expand Down