Comments (2)
Hi there!
Because the buffer length is never set to anything different than 0
:)
assert_eq(buf.len(),0)
will be true in your example.
Just setting the capacity does nothing to the length.
Instead of trying "to be smart", just create a slice with the source data
and let the vector extend from it. It automatically sets its capacity and length then.
from uefi-rs.
Thanks for your reply and you are right, this help me a lot.
from uefi-rs.
Related Issues (20)
- Allow building device paths as constants HOT 2
- Dependency Dashboard
- Tracking Issue: High-level API filesystem usability HOT 4
- Nevermind... HOT 1
- How to make a runtime driver? 🤔 HOT 9
- Allow getting a MemoryMap from a pointer
- how can I found the `Miscellaneous Protocols` and use it HOT 17
- How do I get a device path of a efi image? HOT 2
- Nuke "uefi-services" from repository
- Feature Request: Implementing MP Protocol Compatibility in Hyper-V HOT 3
- Whether a lifecycle container/manager can be provided to store the currently open protocol? HOT 4
- Example application fails to build with "could not find `helpers` in `uefi`" HOT 3
- `uefi::helpers` not found / Rust UEFI Book out of sync HOT 2
- No graphics HOT 2
- Set default features for uefi crate
- Use `cargo xtask fmt --check` in CI
- After 1.83 is released: bump MSRV and un-gate error_in_core impls
- make MemoryMap own its buffer (Vec) HOT 2
- CI failing due to dead_code warnings on nightly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uefi-rs.