-
Notifications
You must be signed in to change notification settings - Fork 21
deps: port to n0-error #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Frando
wants to merge
13
commits into
main
Choose a base branch
from
Frando/iroh-095
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+564
−630
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
efa24eb
update
Frando 8e0adef
refactor: chatgpt ports to n0-error
Frando 8d0af32
fix fix fix fix
Frando 1bd5271
fixup
Frando 3841969
more fix fix fix
Frando 94b7032
fmt
Frando 3cfc77c
fixup
Frando 549c9d7
clippy
Frando 5d9783e
deps: remove anyhow
Frando b4a41e0
re-add anyhow as dev dependency
Frando ec16316
Merge remote-tracking branch 'origin/main' into Frando/iroh-095
Frando d2dc3e0
chore: fmt
Frando 26a5bc7
fixup wasm
Frando File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,17 +35,18 @@ Here is a basic example of how to set up `iroh-blobs` with `iroh`: | |
| ```rust,no_run | ||
| use iroh::{protocol::Router, Endpoint}; | ||
| use iroh_blobs::{store::mem::MemStore, BlobsProtocol, ticket::BlobTicket}; | ||
| use n0_error::{Result, StdResultExt}; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> anyhow::Result<()> { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we decided to use anyhow in examples, how about we also keep using anyhow in the readme, which is kinda an example? |
||
| async fn main() -> Result<()> { | ||
| // create an iroh endpoint that includes the standard discovery mechanisms | ||
| // we've built at number0 | ||
| let endpoint = Endpoint::bind().await?; | ||
|
|
||
| // create a protocol handler using an in-memory blob store. | ||
| let store = MemStore::new(); | ||
| let tag = store.add_slice(b"Hello world").await?; | ||
|
|
||
| let _ = endpoint.online().await; | ||
| let addr = endpoint.addr(); | ||
| let ticket = BlobTicket::new(addr, tag.hash, tag.format); | ||
|
|
@@ -62,7 +63,7 @@ async fn main() -> anyhow::Result<()> { | |
| tokio::signal::ctrl_c().await; | ||
|
|
||
| // clean shutdown of router and store | ||
| router.shutdown().await?; | ||
| router.shutdown().await.anyerr()?; | ||
| Ok(()) | ||
| } | ||
| ``` | ||
|
|
@@ -86,4 +87,4 @@ at your option. | |
|
|
||
| Unless you explicitly state otherwise, any contribution intentionally submitted | ||
| for inclusion in this project by you, as defined in the Apache-2.0 license, | ||
| shall be dual licensed as above, without any additional terms or conditions. | ||
| shall be dual licensed as above, without any additional terms or conditions. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.