diff --git a/smart-house/Cargo.toml b/smart-house/Cargo.toml index 6d4e7db..acf1eb6 100644 --- a/smart-house/Cargo.toml +++ b/smart-house/Cargo.toml @@ -1,8 +1,5 @@ -[package] -edition = "2024" -name = "smart-house" -version = "0.0.0" - -[dependencies] -tokio = { version = "1.49.0", features = ["rt", "net", "io-util", "time"] } -rand = { version = "0.10.0", features = ["std"] } +[workspace] +resolver = "3" +members = [ + "house" +] diff --git a/smart-house/house/Cargo.toml b/smart-house/house/Cargo.toml new file mode 100644 index 0000000..6d4e7db --- /dev/null +++ b/smart-house/house/Cargo.toml @@ -0,0 +1,8 @@ +[package] +edition = "2024" +name = "smart-house" +version = "0.0.0" + +[dependencies] +tokio = { version = "1.49.0", features = ["rt", "net", "io-util", "time"] } +rand = { version = "0.10.0", features = ["std"] } diff --git a/smart-house/src/bin/house_builder.rs b/smart-house/house/src/bin/house_builder.rs similarity index 100% rename from smart-house/src/bin/house_builder.rs rename to smart-house/house/src/bin/house_builder.rs diff --git a/smart-house/src/bin/mocks_example.rs b/smart-house/house/src/bin/mocks_example.rs similarity index 100% rename from smart-house/src/bin/mocks_example.rs rename to smart-house/house/src/bin/mocks_example.rs diff --git a/smart-house/src/bin/power_socket_client.rs b/smart-house/house/src/bin/power_socket_client.rs similarity index 100% rename from smart-house/src/bin/power_socket_client.rs rename to smart-house/house/src/bin/power_socket_client.rs diff --git a/smart-house/src/bin/power_socket_mock.rs b/smart-house/house/src/bin/power_socket_mock.rs similarity index 100% rename from smart-house/src/bin/power_socket_mock.rs rename to smart-house/house/src/bin/power_socket_mock.rs diff --git a/smart-house/src/bin/reporter.rs b/smart-house/house/src/bin/reporter.rs similarity index 100% rename from smart-house/src/bin/reporter.rs rename to smart-house/house/src/bin/reporter.rs diff --git a/smart-house/src/bin/stubs_example.rs b/smart-house/house/src/bin/stubs_example.rs similarity index 100% rename from smart-house/src/bin/stubs_example.rs rename to smart-house/house/src/bin/stubs_example.rs diff --git a/smart-house/src/bin/subscribers.rs b/smart-house/house/src/bin/subscribers.rs similarity index 100% rename from smart-house/src/bin/subscribers.rs rename to smart-house/house/src/bin/subscribers.rs diff --git a/smart-house/src/bin/thermometer_mock.rs b/smart-house/house/src/bin/thermometer_mock.rs similarity index 100% rename from smart-house/src/bin/thermometer_mock.rs rename to smart-house/house/src/bin/thermometer_mock.rs diff --git a/smart-house/src/builders.rs b/smart-house/house/src/builders.rs similarity index 100% rename from smart-house/src/builders.rs rename to smart-house/house/src/builders.rs diff --git a/smart-house/src/device.rs b/smart-house/house/src/device.rs similarity index 100% rename from smart-house/src/device.rs rename to smart-house/house/src/device.rs diff --git a/smart-house/src/error.rs b/smart-house/house/src/error.rs similarity index 100% rename from smart-house/src/error.rs rename to smart-house/house/src/error.rs diff --git a/smart-house/src/house.rs b/smart-house/house/src/house.rs similarity index 97% rename from smart-house/src/house.rs rename to smart-house/house/src/house.rs index ede8ec6..792e9ed 100644 --- a/smart-house/src/house.rs +++ b/smart-house/house/src/house.rs @@ -42,8 +42,8 @@ impl House { impl PrintStatus for House { fn print_status_into(&self, out: &mut dyn Write) -> Result<(), std::io::Error> { for (room_name, room) in self.rooms.iter() { - out.write_fmt(format_args!("{}:", room_name))?; - out.write_fmt(format_args!("{}", "-".repeat(32)))?; + out.write_fmt(format_args!("{}:\n", room_name))?; + out.write_fmt(format_args!("{}\n", "-".repeat(32)))?; room.print_status_into(out)?; out.write_fmt(format_args!("\n"))?; println!(); diff --git a/smart-house/src/lib.rs b/smart-house/house/src/lib.rs similarity index 100% rename from smart-house/src/lib.rs rename to smart-house/house/src/lib.rs diff --git a/smart-house/src/main.rs b/smart-house/house/src/main.rs similarity index 100% rename from smart-house/src/main.rs rename to smart-house/house/src/main.rs diff --git a/smart-house/src/power_socket.rs b/smart-house/house/src/power_socket.rs similarity index 100% rename from smart-house/src/power_socket.rs rename to smart-house/house/src/power_socket.rs diff --git a/smart-house/src/print_status.rs b/smart-house/house/src/print_status.rs similarity index 100% rename from smart-house/src/print_status.rs rename to smart-house/house/src/print_status.rs diff --git a/smart-house/src/reporter.rs b/smart-house/house/src/reporter.rs similarity index 100% rename from smart-house/src/reporter.rs rename to smart-house/house/src/reporter.rs diff --git a/smart-house/src/room.rs b/smart-house/house/src/room.rs similarity index 100% rename from smart-house/src/room.rs rename to smart-house/house/src/room.rs diff --git a/smart-house/src/subscriber.rs b/smart-house/house/src/subscriber.rs similarity index 100% rename from smart-house/src/subscriber.rs rename to smart-house/house/src/subscriber.rs diff --git a/smart-house/src/thermometer.rs b/smart-house/house/src/thermometer.rs similarity index 100% rename from smart-house/src/thermometer.rs rename to smart-house/house/src/thermometer.rs