Skip to content

Commit

Permalink
BADGE :D
Browse files Browse the repository at this point in the history
  • Loading branch information
alembiq committed Jun 25, 2024
1 parent b02d4c3 commit 8142704
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Rust](https://github.com/alembiq/rust-developer/actions/workflows/rust.yml/badge.svg)](https://github.com/alembiq/rust-developer/actions/workflows/rust.yml)


# Some random notes and links ;)
## Course related links
- [classroom](https://classroom.google.com/c/NjU2NTMyOTI1NDY3)
Expand Down
5 changes: 1 addition & 4 deletions lesson13/server13/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() {
listen_and_accept(server_address)
}

// Accepting communication from client and processing their messages.
/// Accepting communication from client and processing their messages.
fn listen_and_accept(address: String) {
//FIXME error listening
let listener = match TcpListener::bind(address) {
Expand All @@ -47,12 +47,10 @@ fn listen_and_accept(address: String) {

match message {
MessageType::Text(text) => {
//TEXT message
println!("{} {addr}: {text:?}", current_time());
reply = "Received".into();
}
MessageType::File(name, content) => {
//FILE transfer
//TODO unable to save
//TODO file already exist
reply = format!("{} saving: {}/{}", current_time(), DIRECTORY_FILES, name);
Expand All @@ -61,7 +59,6 @@ fn listen_and_accept(address: String) {
.expect("Could not write file");
}
MessageType::Image(image) => {
//IMAGE transfer
//TODO unable to save
//TODO file already exist
let timestamp: String = std::time::UNIX_EPOCH
Expand Down
2 changes: 1 addition & 1 deletion lesson13/shared13/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn server_address(args: Vec<String>) -> String {
}
}

/// MESSAGE HANDLING mayre redo in the future as implementations of MessaType
/// MESSAGE HANDLING maybe redo as implementations of MessageType
#[derive(Serialize, Deserialize, Debug)]
pub enum MessageType {
Expand Down

0 comments on commit 8142704

Please sign in to comment.