Conversation
This reverts commit fe9f248.
|
I think this is good to go now, as most improvements (imho) are already captured in issues, and I don't want it to grow even bigger. @FintanH @massimiliano-mantione let me know if you want this to stay open for studying. I'll do all further work in separate branches on top of this, tho. |
FintanH
left a comment
There was a problem hiding this comment.
Ya, looks good to me. Harder to review something so large so I appreciate the run down. I think I'll get it more when I have to interact with the code :)
librad/examples/mesh.rs
Outdated
| export: peer.paths.projects_dir().into(), | ||
| }; | ||
|
|
||
| let endpoint = Endpoint::bind(&key, "127.0.0.1:0".parse().unwrap()).await?; |
There was a problem hiding this comment.
I know that this is the example so I don't expect squeaky clean code, but there seems to be a mix unwrap and ? in this body, any reason why?
There was a problem hiding this comment.
The unwrap is for parsing of the SocketAddr, which we “know” is well-formed. The bind can still fail with an IO error.
Idk, maybe there is a macro somewhere which can validate IP addresses statically, or we can write one? I’m guessing that we will have more than one hard-coded address down the road.
There was a problem hiding this comment.
Might be possible to use Ipv4Addr::new(127, 0, 0, 1)
There was a problem hiding this comment.
Ah missed that. It's a bit verbose, tho (note the port number)
| .await | ||
| .unwrap(); | ||
|
|
||
| let disco = discovery::Static::new( |
There was a problem hiding this comment.
I’m still pondering over a combinator for discos, which abides to the law that when you combine two discos you get a new disco with two dance floors.
There was a problem hiding this comment.
We could also have fun things like:
disco.dancing_at_the_disco_everybody_lets_go_wheres_me_jumper_wheres_me_jumper()
There was a problem hiding this comment.
Do jumpers form a monoid?
There was a problem hiding this comment.
Monoid in the category of cardigans
|
Closed via 294b785 |
Still bit of cleanup and docs required. Look at
examples/mesh.rsto see actual git cloning in action